<template>
    <!-- 续期核保处理-详情 -->
    <div class="underwriting">
        <div v-if="subUnLoading" v-loading="subUnLoading"
             element-loading-text="拼命加载中..."
             element-loading-spinner="el-icon-loading"
             class="sub-loading">
        </div>

        <div class="underwriting-base" v-loading.fullscreen.lock="fullscreenLoading">
            <el-tabs @tab-click="handleClick" class="base-title">
                <div name="first" class="item-title">
                    <el-row>
                        <el-col :span="3">
                            <div @click="showItem(0)" class="item">累计保额</div>
                        </el-col>
                        <el-col :span="3">
                            <div @click="showItem(1)" class="item" v-if="isCoreReason">
                                提核原因（{{insTabInfo.insCoreReasons.length}}）
                            </div>
                            <div class="item" v-else>提核原因（<i class="el-icon-loading"></i>）</div>
                        </el-col>
                        <el-col :span="3">
                            <div @click="showItem(2)" class="item" v-if="isInsClaims">
                                理赔历史（{{insTabInfo.insClaims.length}}）
                            </div>
                            <div  class="item" v-else>理赔历史（<i class="el-icon-loading"></i>）</div>
                        </el-col>
                        <el-col :span="3">
                            <div @click="showItem(3)" class="item" v-if="isInsHistorys">
                                投保记录({{insTabInfo.insHistorysCount}})
                            </div>
                            <div class="item" v-else>投保记录(<i class="el-icon-loading"></i>)</div>
                        </el-col>
                        <el-col :span="3">
                            <div @click="showItem(4)" class="item" v-if="isInsNotepads">
                                Notepad（{{insNoteSize}}）
                            </div>
                            <div  class="item" v-else>Notepad（<i class="el-icon-loading"></i>）</div>
                        </el-col>
                        <el-col :span="3">
                            <div @click="showItem(5)" class="item" v-if="isInsPoss">
                                保全记录（{{insTabInfo.insPoss.length}}）
                            </div>
                            <div  class="item" v-else>保全记录（<i class="el-icon-loading"></i>）</div>
                        </el-col>

                        <el-col :span="3">
                            <div @click="showItem(6)" class="item" v-if="isInsRenews">
                                续核记录（{{insTabInfo.insCount}}）
                            </div>
                            <div  class="item" v-else>续核记录（<i class="el-icon-loading"></i>）</div>
                        </el-col>
                        <el-col :span="3">
                            <div @click="showItem(7)" class="item" v-if="isInsHealths">
                                异常告知一览（{{insTabInfo.insHealths.length}}）
                            </div>
                            <div  class="item" v-else>异常告知一览（<i class="el-icon-loading"></i>）</div>
                        </el-col>
                        <el-col :span="3">
                            <div @click="showItem(8)" class="item" v-if="isInsExams">
                                体检报告一览（{{insTabInfo.insExams.length}}）
                            </div>
                            <div  class="item" v-else>体检报告一览（<i class="el-icon-loading"></i>）</div>
                        </el-col>
                        <el-col :span="3">
                            <div @click="showItem(9)" class="item" v-if="isAppSupplements">
                                补充告知一览（{{insTabInfo.insSupplements.length}}）
                            </div>
                            <div  class="item" v-else>补充告知一览（<i class="el-icon-loading"></i>）</div>
                        </el-col>
                    </el-row>
                </div>
            </el-tabs>
            <el-row class="base-mian">

                <!-- 投保记录 -->
                <insurance-records v-if="recordFlag" :recordFlag="recordFlag" :clmnum="clmnum"
                                   @showLoading="showLoading"          @subRecordFlag="getSubRecordFlag"></insurance-records>

                <!-- 提核原因 -->
                <core-extraction v-if="coreReasonFlag" :coreReasonFlag="coreReasonFlag" @showLoading="showLoading"
                                 :archtype="euruVO.archtype" :reasons="insTabInfo.insCoreReasons"
                                 @subReasonFlag="getSubCoreReasonFlag"></core-extraction>

                <!-- 累计保额 -->
                <accumulated-premium v-if="cumAmountFlag" :cumAmountFlag="cumAmountFlag" :clntnum="pageData.dto.clntnum"
                                     @showLoading="showLoading"         @subCumAmountFlag="getSubCumAmountFlag"></accumulated-premium>

                <!-- 理赔历史 -->
                <claims-records v-if="claimsFlag" :claimsFlag="claimsFlag" @showLoading="showLoading"
                                :policyNo="pageData.dto.chdrnum" @subClaimsFlag="getSubClaimsFlag"></claims-records>

                <!-- Notepad -->
                <notepad v-if="notepadFlag"  :clntnum="pageData.dto.clntnum" :surname="pageData.dto.surname" :curUserId="userId"
                         @insNoteSize="getInsNoteSize" @showLoading="showLoading"
                         :btnDisable="btnDisable"   :notepadFlag="notepadFlag" @subNotepadFlag="getSubNotepadFlag"></notepad>

                <!-- 保全记录 -->
                <keep-record v-if="saveDamageFlag" :saveDamageFlag="saveDamageFlag"
                             @showLoading="showLoading"
                             :poss="insTabInfo.insPoss"    @subSaveDamageFlag="getSubSaveDamageFlag"></keep-record>

                <!-- 续核记录 -->
                <review-opinion v-if="reviewFlag" :reviewFlag="reviewFlag" @showLoading="showLoading"
                :clntnum="pageData.dto.clntnum" @subReviewFlag="getSubReviewFlag"></review-opinion>


                <!-- 异常告知一览 -->
                <abnormal-told v-if="abnormityFlag" :abnormityFlag="abnormityFlag"
                               :healths="insTabInfo.insHealths" @showLoading="showLoading"
                               @subAbnormityFlag="getSubAbnormityFlag"></abnormal-told>

                <!-- 体检报告一览 -->
                <medical-report v-if="healthFlag" :healthFlag="healthFlag"
                                :clntnum="clmnum"
                                @showLoading="showLoading"
                                @subHealthFlag="getSubHealthFlag"></medical-report>

                <!-- 补充告知书一览 -->
                <supplementary-told v-if="reportFlag" :reportFlag="reportFlag" :clmnum="clmnum"
                                    @showLoading="showLoading"
                                    @subReportFlag="getSubReportFlag"></supplementary-told>

                <!-- 委托人信息 -->
                <!-- <consignor v-if="consignorFlag" :consignorFlag="consignorFlag" @subConsignorFlag="getSubConsignorFlag"></consignor> -->


                <!-- 个人税收居民身份证明 -->
                <!-- <identity-card v-if="IDFlag" :IDFlag="IDFlag" @subIDFlag="getSubIDFlag"></identity-card> -->

            </el-row>

            <div class="policy-main">
                <!-- 右侧操作按钮 -->
                <suspend-nav @doSave="doSave" @subNucleusDecide="subNucleusDecide" @back="back"
                             @backToUw="backToUw" :lockFlag="lockFlag" :btnDisable="btnDisable"></suspend-nav>

                <div class="policy-main-title">
                    <i class="el-icon-tickets"></i>
                    <span>保单信息</span>
                </div>
                <div class="policy-main-container">
                    <!-- 保单信息表单 -->
                    <el-form label-width="120px" class="search_container">
                        <el-row class="mt10">
                            <el-col :span="6">
                                <el-form-item label="受理号码" prop="">
                                    <el-input disabled v-if="pageData.dto" v-model="pageData.dto.clmnum"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="保单生效日" prop="sumins01">
                                    <el-input disabled v-if="pageData.dto" v-model="pageData.dto.occdate"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="职业等级" prop="sumins02">
                                    <el-input disabled v-if="pageData.dto" v-model="pageData.dto.mortcls"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="营销员组织代码" prop="stdflag">
                                    <el-input disabled v-if="pageData.dto" v-model="pageData.dto.agntcd"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="保单号码" prop="sumasind">
                                    <el-input disabled v-if="pageData.dto" v-model="pageData.dto.chdrnum"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="复效日期" prop="sumins01">
                                    <el-input disabled v-if="pageData.dto" v-model="pageData.dto.reinsdate"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="处理状态" prop="sumins02" v-if="pageData.dto" >
                                    <el-input disabled v-if="pageData.dto.flag01=='0'" value="0-待处理"></el-input>
                                    <el-input disabled v-else-if="pageData.dto.flag01=='1'" value="1-受理"></el-input>
                                    <el-input disabled v-else-if="pageData.dto.flag01=='2'" value="2-核保"></el-input>
                                    <el-input disabled v-else-if="pageData.dto.flag01=='5'" value="5-照会中"></el-input>
                                    <el-input disabled v-else-if="pageData.dto.flag01=='6'"
                                              value="6-照会已回复待处理"></el-input>
                                    <el-input disabled v-else-if="pageData.dto.flag01=='7'"
                                              value="7-送其它部门处理"></el-input>
                                    <el-input disabled v-else-if="pageData.dto.flag01=='9'" value="9-结案"></el-input>
                                    <el-input disabled v-else-if="pageData.dto.flag01=='A'" value="A-撤回"></el-input>
                                    <el-input disabled v-else-if="pageData.dto.flag01=='B'" value="B-结案失败"></el-input>
                                    <el-input disabled v-else-if="pageData.dto.flag01=='C'"
                                              value="C-照会逾期未回复"></el-input>
                                    <el-input disabled v-else-if="pageData.dto.flag01=='D'"
                                              value="D-特殊件照会回复待"></el-input>
                                </el-form-item>
                                <el-form-item label="处理状态" prop="sumins02" v-else >
                                    <el-input disabled
                                              value=""></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="营销员代码" prop="stdflag">
                                    <el-input disabled v-if="pageData.dto" v-model="pageData.dto.oagntid"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="投保人姓名" prop="cownname">
                                    <el-input disabled v-if="pageData.dto" v-model="pageData.dto.cownname"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="保单状态" prop="sumins01">
                                    <el-input disabled v-if="pageData.dto" v-model="pageData.dto.statcode"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="处理日期" prop="sumins02">
                                    <el-input disabled v-if="pageData.dto" v-model="pageData.dto.crtdate"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="营销员姓名" prop="stdflag">
                                    <el-input disabled v-if="pageData.dto" v-model="pageData.dto.agntname"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="被保人姓名" prop="sumasind">
                                    <el-input disabled v-if="pageData.dto" v-model="pageData.dto.surname"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="保费状态" prop="sumins01">
                                    <el-input disabled v-if="pageData.dto" v-model="pageData.dto.pstatcode"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="核保人员" prop="sumins02">
                                    <el-input disabled v-if="pageData.dto" v-model="pageData.dto.crtuser"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="被保人证件号码" prop="stdflag">
                                    <el-input disabled v-if="pageData.dto" v-model="pageData.dto.secuityno"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="A类B类" prop="stdflag">
                                    <el-input disabled v-if="pageData.dto" v-model="pageData.checkAgn"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>

                    <!-- 保单信息表格 -->
                    <div class="table_container">
                        <el-table
                                :data="pageData.eurdList"
                                highlight-current-row
                                header-cell-class-name="table-header-class"
                                style="width:100%">
<!--                            <el-table-column type="selection" width="55"></el-table-column>-->
                            <el-table-column width="120" property="descitem" label="序号"
                                             type="index" align='center'>
                            </el-table-column>
                            <el-table-column
                                    width="120" property="showChdrnum" label="保单号码" align='center'>
                            </el-table-column>
                            <el-table-column
                                    width="120" property="age" label="年龄" align='center'>
                            </el-table-column>
                            <el-table-column
                                    width="120" property="crtable" label="险种" align='center'>
                                <template slot-scope="scope">
                                    <span :title="scope.row.notedesc"> {{scope.row.crtable}}</span>
                                </template>
                            </el-table-column>
                            <el-table-column
                                    width="120" property="sumins" label="保额/计划" align='center'>
                            </el-table-column>
                            <el-table-column
                                    width="120" property="crrcd" label="生效日期" align='center'>
                            </el-table-column>
                            <el-table-column
                                    width="120" property="rerateDate" label="Rerate Date" align='center'>
                            </el-table-column>
                            <el-table-column
                                    width="120" property="effdate" label="Eff Date" align='center'>
                            </el-table-column>
                            <el-table-column
                                    width="120" property="riskCessDate" label="终止日期" align='center'>
                            </el-table-column>
                            <el-table-column
                                    width="120" property="statcode" label="险种状态" align='center'>
                            </el-table-column>
                            <el-table-column
                                    width="120" property="pstatcode" label="保费状态" align='center'>
                            </el-table-column>
                            <el-table-column
                                    width="120" property="clamamt" label="原总保费" align='center'>
                            </el-table-column>
                            <el-table-column
                                    width="120" property="instprem" label="总保费" align='center'>
                            </el-table-column>
                            <el-table-column
                                    width="120" property="zbinstprem" label="基本保费" align='center'>
                            </el-table-column>
                            <el-table-column
                                    width="120" property="zlinstprem" label="次标保费" align='center'>
                            </el-table-column>
                            <el-table-column
                                    width="150" property="mind" label="续核结论" align='center'>
                                <template slot-scope="scope">
                                    <el-select v-if="!btnDisable &&  (scope.row.t3640 == '1' && (scope.row.statcode == 'IF' || scope.row.statcode == 'PH'))"
                                               @change="mindOnChane(scope.row)" v-model="scope.row.mind" placeholder="">
                                        <el-option
                                                v-for="item in pageData.midnList"
                                                :key="item.value"
                                                :label="item.option"
                                                :value="item.value">
                                        </el-option>
                                    </el-select>
                                    <el-select v-else disabled v-model="scope.row.mind" class="sel-bgf3"
                                               placeholder="">
                                        <el-option
                                                v-for="item in pageData.midnList"
                                                :key="item.value"
                                                :label="item.option"
                                                :value="item.value">
                                        </el-option>
                                    </el-select>
                                </template>
                            </el-table-column>
                            <el-table-column
                                    width="120" property="remark02" label="操作" align='center'>
                                <template slot-scope="scope">
                                <span class="operationIcon" @click="notRenew(scope.row)">
                                    <!-- 不予续保 -->
                                    <el-tooltip class="item" effect="light" content="不予续保" placement="top">
                                        <i class="el-icon-folder-delete"></i>
                                  </el-tooltip>
                                </span>
                                    <span class="operationIcon ml10" @click="addCost(scope.row)">
                                    <!-- 加费 -->
                                    <el-tooltip class="item" effect="light" content="加费" placement="top">
                                        <i class="el-icon-folder-add"></i>
                                    </el-tooltip>
                                </span>
                                    <span class="operationIcon ml10" @click="postil(scope.row)">
                                    <!-- 除外 -->
                                    <el-tooltip class="item" effect="light" content="除外" placement="top">
                                        <i class="el-icon-edit-outline"></i>
                                    </el-tooltip>
                                </span>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>

                    <!-- 照会内容 -->
                    <div class="con mt20">
                        <div class="title">
                            <span>照会内容</span>
                        </div>
                        <div class="table_container">
                            <el-form ref="form" label-width="60px">
                                <el-table
                                        :data="eubaList"
                                        style="width: 100%">
                                    <el-table-column property="clntnum" label="照会对像"  min-width="120">
                                        <template slot-scope="scope">
                                            <label>{{pageData.dto.surname}}</label>
                                        </template>
                                    </el-table-column>
                                    <el-table-column property="pncode" label="照会代码"  min-width="120"></el-table-column>
                                    <el-table-column property="procflg" label="处理码"  min-width="120">
                                        <template slot-scope="scope">
                                            <el-input v-if="!btnDisable" @blur="changeProcflg(scope.row)"
                                                      :ref="`procflg${scope.row.index}`"
                                                      @keyup.up.native="procflgUpKey(scope.row)"
                                                      @keyup.down.native="procflgDownKey(scope.row)"
                                                      @change="changeProcflg(scope.row)"
                                                      v-model="scope.row.procflg"></el-input>
                                            <el-input v-else readonly class="cell-bgf3"
                                                      :ref="`procflg${scope.row.index}`"
                                                      @keyup.up.native="procflgUpKey(scope.row)"
                                                      @keyup.down.native="procflgDownKey(scope.row)"
                                                      v-model="scope.row.procflg"></el-input>
                                        </template>
                                    </el-table-column>
                                    <el-table-column property="pedesc" label="照会说明" show-overflow-tooltip min-width="400">
                                        <template slot-scope="scope">
<!--                                            <el-input v-if="!btnDisable && scope.row.isEdit" @change="triggerInput(scope.row)" v-model="scope.row.pedesc" :title="scope.row.pedesc"></el-input>-->
                                            <el-input  readonly class="cell-bgf3" v-model="scope.row.pedesc" :title="scope.row.pedesc"></el-input>
                                        </template>
                                    </el-table-column>
                                    <el-table-column property="dtecrt" label="照会日期"  min-width="120"></el-table-column>
                                    <el-table-column property="rprntdate" label="打印日期"  min-width="120"></el-table-column>
                                    <el-table-column property="dateend" label="核销日期"  min-width="120"></el-table-column>
                                    <el-table-column property="pnfrom" label="照会来源"  min-width="120"></el-table-column>
                                    <el-table-column property="userid" label="核准人"  min-width="120"></el-table-column>
                                </el-table>
                                <el-row class="mt20">
                                    <el-col :span="3">
                                        <el-form-item label="核准" prop="flag">
                                             <el-select v-if="!btnDisable" v-model="pageData.dto.flag06" placeholder="请选择" @change="onChangeFlag01">
                                                    <el-option
                                                          v-for="item in options"
                                                           :key="item.value"
                                                           :label="item.label"
                                                           :value="item.value">
                                                    </el-option>
                                              </el-select>
                                             <el-select v-else v-model="pageData.dto.flag06" class="sel-bgf3" placeholder="请选择" disabled>
                                                    <el-option
                                                          v-for="item in options"
                                                           :key="item.value"
                                                           :label="item.label"
                                                           :value="item.value">
                                                    </el-option>
                                              </el-select>
                                        </el-form-item>
                                    </el-col>
                                </el-row>
                            </el-form>
                        </div>
                    </div>
                    <!-- 核保意见 -->
                    <div class="con mt20">
                        <div class="title">
                            <span>核保意见</span>
                        </div>
                        <div class="table_container">
                            <el-table
                                    :data="eurgs" @row-click="showDesc(eurgs,$event)"
                                    :row-class-name="tableRowClassName" :row-style="selectHeight">
                                <el-table-column property="bmntdesc" label="核保意见"></el-table-column>
                                <el-table-column width="150" property="effdate" label="日期"></el-table-column>
                                <el-table-column width="150" property="userProfile" label="核保员"></el-table-column>
                            </el-table>
                            <!-- 操作按钮 -->
                            <el-row>
                                <el-col :span="24" class="pb15 pt15" v-if="!btnDisable">
                                    <el-button class="check-info" @click="addEurg">新增</el-button>
                                    <el-button class="check-info ml10" @click="editEurg">更新</el-button>
                                    <el-button class="check-info-def ml10" @click="delEurg">删除</el-button>
                                </el-col>
                                <el-col :span="24" class="pb15 pt15" v-else>
                                    <el-button class="check-info" disabled>新增</el-button>
                                    <el-button class="check-info ml10"  disabled>更新</el-button>
                                    <el-button class="check-info-def ml10"  disabled>删除</el-button>
                                </el-col>
                            </el-row>
                            <el-row class="editInput">
                                <el-col :span="24">
                                    <el-input type="textarea" :rows="5" v-model="bmntdesc"
                                              placeholder="请输入内容"></el-input>
                                </el-col>
                            </el-row>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- 弹框开始 -->

        <!-- 状态回退 -->
        <el-dialog
                title="状态回退"
                :visible.sync="stateBackFlag"
                width="60%"
                v-loading="backLoading"
                element-loading-text="拼命加载中..."
                element-loading-spinner="el-icon-loading"
                center>
            <el-row>
                <el-col :span="24">
                    <button class="check-info" @click="addStateBack">新增</button>
                    <button class="check-info ml20" @click="updateStateBack">更新</button>
                    <button class="check-info ml20" @click="delStateBack">删除</button>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-table :data="eurhs" class="mt10" @row-click="showDesc1(eurgs,$event)"
                              :row-class-name="tableRowClassName1" :row-style="selectHeight1">
                        <el-table-column property="notedesc" label="回退步骤" min-width="120" show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column property="bmntdesc" label="回退原因" min-width="120" show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column property="userProfile" label="状态回退人员" min-width="120" show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column property="effdate" label="状态回退日期" min-width="160" show-overflow-tooltip>
                        </el-table-column>
                    </el-table>
                </el-col>
                <el-col :span="24" class="mt20">
                    <el-input placeholder="请输入" class="cell-bgf3" v-model="eurhdesc"
                              type="textarea"></el-input>
                </el-col>
            </el-row>

            <span slot="footer" class="dialog-footer">
            <el-button type="primary" @click="backNul">状态回退</el-button>
            <el-button @click="stateBackFlag = false">返 回</el-button>
        </span>
        </el-dialog>

        <!-- 退回续核 -->
        <el-dialog
                title="退回续核"
                :visible.sync="backTouWFlag"
                width="60%"
                center>
            <el-row>
                <el-col :span="24">
                    <el-table :data="backToUwDatas">
                        <el-table-column property="notedesc" label="退回续核原因" min-width="200">
                            <template slot-scope="scope">
                                <el-input v-if="backContinueNucleusControlFlag" readonly
                                          v-model="scope.row.notedesc"
                                          placeholder="请输入内容">
                                </el-input>
                                <el-input v-else @change="modifyDesc(scope.row)"
                                          v-model="scope.row.notedesc"
                                          placeholder="请输入内容">
                                </el-input>
                            </template>
                        </el-table-column>
                        <el-table-column property="userid" label="退回续核人员" min-width="120" show-overflow-tooltip>
                        </el-table-column>
                        <el-table-column property="effdate" label="退回续核日期" min-width="160" show-overflow-tooltip>
                        </el-table-column>
                    </el-table>
                </el-col>

            </el-row>

            <span slot="footer" class="dialog-footer">
            <el-button type="primary" v-if="backContinueNucleusControlFlag" disabled>退回续核</el-button>
            <el-button type="primary" v-else @click="backNu2">退回续核</el-button>
            <el-button @click="backTouWFlag = false">返 回</el-button>
        </span>
        </el-dialog>

        <!-- 加费 -->
        <el-dialog
                title="加费"
                :visible.sync="addCostFlag"
                width="60%"
                v-loading="apLoading"
                element-loading-text="拼命加载中..."
                element-loading-spinner="el-icon-loading"
                center>
            <el-row>
                <el-col :span="24">
                    <el-col :span="12">
                        <el-col :span="8">
                            <label class="complain-lab">被保险人姓名</label>
                        </el-col>
                        <el-col :span="14">
                            <el-input placeholder="请输入" v-model="premiumTempVO.as_surname" readonly></el-input>
                        </el-col>
                    </el-col>
                    <el-col :span="12">
                        <el-col :span="8">
                            <label class="complain-lab">险种名称</label>
                        </el-col>
                        <el-col :span="14">
                            <el-input placeholder="请输入" v-model="premiumTempVO.as_polpln" readonly></el-input>
                        </el-col>
                    </el-col>
                </el-col>
                <el-col :span="24" class="mt10">
                    <el-col :span="4">
                        <label class="complain-lab">加费原因</label>
                    </el-col>
                    <el-col :span="19">
                        <el-input v-if="!btnDisable" placeholder="请输入" class="cell-bgf3" v-model="premiumTempVO.notedesc01"
                                  type="textarea" ></el-input>
                        <el-input v-else placeholder="请输入" class="cell-bgf3" v-model="premiumTempVO.notedesc01"
                                  type="textarea" readonly></el-input>
                    </el-col>
                </el-col>
                <el-col :span="24" v-if="isHiTr" class="mt10">
                    <el-col :span="12">
                        <el-col :span="10">
                            <label class="complain-lab">HI加费</label>
                        </el-col>
                        <el-col :span="14">
                            <el-input placeholder="请输入" v-model="premiumTempVO.phi"
                                      @blur="premiumItemchanged(scope.row)"></el-input>
                        </el-col>
                    </el-col>
                    <el-col :span="12">
                        <el-col :span="10">
                            <label class="complain-lab">WP加费</label>
                        </el-col>
                        <el-col :span="14">
                            <el-input placeholder="请输入" v-model="premiumTempVO.pwp"
                                      @blur="premiumItemchanged(scope.row)"></el-input>
                        </el-col>
                    </el-col>
                </el-col>
                <el-col :span="24" v-if="isHiTr" class="mt10">
                    <el-col :span="12">
                        <el-col :span="10">
                            <label class="complain-lab">加权加费值</label>
                        </el-col>
                        <el-col :span="14">
                            <el-input placeholder="请输入" v-model="premiumTempVO.prt" readonly></el-input>
                        </el-col>
                    </el-col>
                    <el-col :span="12">
                    </el-col>
                </el-col>
                <el-col :span="24" class="mt10">
                    <button class="check-info mt10" v-if="!btnDisable" @click="calcClick">试算</button>
                    <button class="check-info mt10 ml20" v-if="!btnDisable" @click="addClick">增加</button>
                </el-col>
            </el-row>
            <el-row id="jf">
                <el-col :span="24">
                    <el-table :data="premiumTempList" class="mt10">
                        <el-table-column property="date" label="加费类别">
                            <template slot-scope="scope">
                                <el-select class="cell-bgb7" v-if="scope.row.opcdaBg=='RB'" disabled placeholder="请选择" v-model="scope.row.opcda">
                                    <el-option
                                            v-for="con in opcdaSelect"
                                            :key="con.value"
                                            :label="con.label"
                                            :value="con.value">
                                    </el-option>
                                </el-select>
                                <el-select v-else class="cell-bgb7" placeholder="请选择" v-model="scope.row.opcda"
                                           @change="opcdaChange(scope.row)">
                                    <el-option
                                            v-for="con in opcdaSelect"
                                            :key="con.value"
                                            :label="con.label"
                                            :value="con.value">
                                    </el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column property="extCessTerm" label="年期">
                            <template slot-scope="scope">
                                <el-input  v-if="scope.row.opcdaBg=='RB'" disabled
                                          class="cell-bgb7" v-model="scope.row.extCessTerm"></el-input>
                                <el-input v-else @change="ext_cess_termChange(scope.row)"
                                          class="cell-bgb7" v-model="scope.row.extCessTerm"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column property="insprm" label="每十万保额加费">
                            <template slot-scope="scope">
                                <el-input @change="insprmChange(scope.row)"
                                          class="cell-bgb7" v-model="scope.row.insprm"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column property="oppc" label="加费百分比">
                            <template slot-scope="scope">
                                <el-input v-if="scope.row.oppcBg == 'RB'" @change="oppcChange(scope.row)"
                                          class="cell-bgb7" readonly v-model="scope.row.oppc"></el-input>
                                <el-input v-else-if="scope.row.oppcBg == 'B'" @change="oppcChange(scope.row)"
                                          class="cell-bgb7" v-model="scope.row.oppc"></el-input>
                                <el-input v-else-if="scope.row.oppcBg == 'RF'" @change="oppcChange(scope.row)"
                                          class="cell-bgf3" readonly v-model="scope.row.oppc"></el-input>
                                <el-input v-else-if="scope.row.oppcBg == 'F'" @change="oppcChange(scope.row)"
                                          class="cell-bgf3" v-model="scope.row.oppc"></el-input>
                                <el-input v-else @change="oppcChange(scope.row)" v-model="scope.row.oppc"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column property="zmortpct" label="TM">
                            <template slot-scope="scope">
                                <el-input v-if="scope.row.zmortpctBg == 'RB'" @change="zmortpctChange(scope.row)"
                                          class="cell-bgb7" readonly v-model="scope.row.zmortpct"></el-input>
                                <el-input v-else-if="scope.row.zmortpctBg == 'B'" @change="zmortpctChange(scope.row)"
                                          class="cell-bgb7" v-model="scope.row.zmortpct"></el-input>
                                <el-input v-else-if="scope.row.zmortpctBg == 'RF'" @change="zmortpctChange(scope.row)"
                                          class="cell-bgf3" readonly v-model="scope.row.zmortpct"></el-input>
                                <el-input v-else-if="scope.row.zmortpctBg == 'F'" @change="zmortpctChange(scope.row)"
                                          class="cell-bgf3" v-model="scope.row.zmortpct"></el-input>
                                <el-input v-else @change="zmortpctChange(scope.row)"
                                          v-model="scope.row.zmortpct"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column property="zlinstprem" label="次标加费">
                            <template slot-scope="scope">
                                <el-input class="cell-bgf3" v-model="scope.row.zlinstprem" disabled></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column property="name" label="操作" v-if="!isPremiumDel">
                            <template slot-scope="scope">
                                <!-- <span @click="delClick(scope.row)" style="cursor: pointer">删除</span> -->
                                <span class="operationIcon" @click="delClick(scope.row)">
                                    <i class="el-icon-delete"></i>
                                </span>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
                <el-col :span="24">

                    <el-col :span="24" class="com-block" style="text-align: right">
                        <span>总加费金额:</span>
                        <span class="com-price">￥{{zlinstpremTotal}}</span>
                    </el-col>
                </el-col>
            </el-row>

            <span slot="footer" class="dialog-footer">
            <el-button type="primary" v-if="!btnDisable" @click="addPremSure">确 定</el-button>
            <el-button @click="addCostFlag = false">返 回</el-button>
        </span>
        </el-dialog>

        <!-- 点击除外代码弹框 -->
        <div class="except-main" v-if="pncodeFlag" style="width:60% !important;" v-loading="tbloading">
            <el-row>
                <el-col :span="8">
                    <el-col :span="10">
                        <label class="complain-lab">照会说明</label>
                    </el-col>
                    <el-col :span="14">
                        <el-input v-model="paginations.pndesc" placeholder="请输入" clearable></el-input>
                    </el-col>
                </el-col>
                <el-col :span="8" class="text_right">
                    <el-button type="primary" icon="el-icon-search" @click="searchPncode"></el-button>
                    <el-button type="primary" plain icon="el-icon-refresh" @click="refreshPncode"></el-button>
                </el-col>
            </el-row>
            <el-row>
                <el-table :data="pnCodes" class="mt10" @row-click="showPncode1">
                    <el-table-column property="pncode" label="照会代码" min-width="120" show-overflow-tooltip>
                        <template slot-scope="scope">
                            <div>
                                {{scope.row.pncode}}
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column property="pedesc" label="照会说明" min-width="200" show-overflow-tooltip>
                        <template slot-scope="scope">
                            <div>
                                {{scope.row.pedesc}}
                            </div>
                        </template>
                    </el-table-column>
                </el-table>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <div class="pagination">
                        <el-pagination
                                background
                                v-if='paginations.total > 0'
                                :page-sizes="paginations.pageSizes"
                                :page-size="paginations.pageSize"
                                :layout="paginations.layout"
                                :total="paginations.total"
                                :current-page='paginations.pageIndex'
                                @current-change='handleCurrentChange'
                                @size-change='handleSizeChange'>
                        </el-pagination>
                    </div>
                </el-col>
            </el-row>
            <div class="back-con">
                <button @click="pncodeFlag = false">返 回</button>
            </div>
        </div>

        <!-- 除外 -->
        <el-dialog
                title="除外"
                :visible.sync="cwFlag"
                width="60%"
                v-loading="cwLoading"
                element-loading-text="拼命加载中"
                element-loading-spinner="el-icon-loading"
                element-loading-background="rgba(0, 0, 0, 0.8)"
                center>
            <el-row>
                <el-col :span="24">
                    <el-col :span="12">
                        <el-col :span="10">
                            <label class="complain-lab">被保险人姓名</label>
                        </el-col>
                        <el-col :span="14">
                            <el-input placeholder="请输入" v-model="postilTempVO.as_surname" readonly disabled></el-input>
                        </el-col>
                    </el-col>
                    <el-col :span="12">
                        <el-col :span="10">
                            <label class="complain-lab">险种名称</label>
                        </el-col>
                        <el-col :span="14">
                            <el-input placeholder="请输入" v-model="postilTempVO.as_polpln" readonly disabled></el-input>
                        </el-col>
                    </el-col>
                </el-col>
                <el-col :span="24" class="mt10">
                    <el-col :span="5">
                        <label class="complain-lab">除外原因</label>
                    </el-col>
                    <el-col :span="19">
                        <el-input placeholder="请输入" v-if="!btnDisable" v-model="postilTempVO.notedesc02" type="textarea" clearable></el-input>
                        <el-input placeholder="请输入" v-else readonly v-model="postilTempVO.notedesc02" type="textarea" disabled></el-input>
                    </el-col>
                </el-col>
                <el-col :span="24" class="mt10">
                    <el-col :span="5">
                        <label class="complain-lab">除外内容</label>
                    </el-col>
                    <el-col :span="19">
                        <el-input placeholder="请输入" v-if="!btnDisable" v-model="postilTempVO.notedesc03" type="textarea" clearable></el-input>
                        <el-input placeholder="请输入" v-else readonly v-model="postilTempVO.notedesc03" type="textarea" disabled></el-input>
                    </el-col>
                </el-col>
<!--                <el-col :span="24" class="mt10">-->
<!--                    <button class="check-info mt10" v-if="!btnDisable" @click="addPostil">增加</button>-->
<!--                </el-col>-->
            </el-row>
<!--            <el-table :data="postilTempList" class="mt10" :row-class-name="exceptName">-->
<!--                <el-table-column property="notecode" label="除外代码" min-width="120" show-overflow-tooltip>-->
<!--                    <template slot-scope="scope">-->
<!--                        <div  @click="showExcept($event,scope.row.index)" :ref="`excSelect${scope.row.index}`">-->
<!--                            <el-input v-on:input="layoutAutoComplate1(scope.row)" v-model="scope.row.notecode"-->
<!--                                      @change="postilItemchanged(scope.row)"></el-input>-->
<!--                        </div>-->
<!--                    </template>-->
<!--                </el-table-column>-->
<!--                <el-table-column property="pedesc" label="除外内容" min-width="200" show-overflow-tooltip>-->
<!--                    <template slot-scope="scope">-->
<!--                        <el-input  v-model="scope.row.notedesc03"></el-input>-->
<!--                    </template>-->
<!--                </el-table-column>-->
<!--                <el-table-column property="name" label="操作"  width="100">-->
<!--                    <template slot-scope="scope">-->
<!--                        &lt;!&ndash; <span @click="delPostil(scope.row)" style="cursor: pointer">删除</span> &ndash;&gt;-->
<!--                        <span class="operationIcon" @click="delPostil(scope.row)">-->
<!--                            <i class="el-icon-delete"></i>-->
<!--                        </span>-->
<!--                    </template>-->
<!--                </el-table-column>-->
<!--            </el-table>-->
            <span slot="footer" class="dialog-footer">
            <el-button type="primary" v-if="!btnDisable" @click="savePostil">确 定</el-button>
            <el-button @click="cwFlag = false">返 回</el-button>
           </span>
        </el-dialog>

        <!-- 不予续保 -->
        <el-dialog
                title="不予续保"
                :visible.sync="nrFlag"
                width="60%"
                v-loading="nrLoading"
                element-loading-text="拼命加载中"
                element-loading-spinner="el-icon-loading"
                element-loading-background="rgba(0, 0, 0, 0.8)"
                center>
            <el-row>
                <el-col :span="24">
                    <el-col :span="12">
                        <el-col :span="10">
                            <label class="complain-lab">被保险人姓名</label>
                        </el-col>
                        <el-col :span="14">
                            <el-input placeholder="请输入" v-model="notreVO.as_surname" readonly disabled></el-input>
                        </el-col>
                    </el-col>
                    <el-col :span="12">
                        <el-col :span="10">
                            <label class="complain-lab">险种名称</label>
                        </el-col>
                        <el-col :span="14">
                            <el-input placeholder="请输入" v-model="notreVO.as_polpln" readonly disabled></el-input>
                        </el-col>
                    </el-col>
                </el-col>
                <el-col :span="24" class="mt10">
                    <el-col :span="5">
                        <label class="complain-lab" >不予续保原因</label>
                    </el-col>
                    <el-col :span="19">
                        <el-input placeholder="请输入" v-if="!btnDisable" v-model="notreVO.notedesc04" @blur="changeNotre" type="textarea" clearable></el-input>
                        <el-input placeholder="请输入" v-else v-model="notreVO.notedesc04"  readonly type="textarea" disabled></el-input>
                    </el-col>
                </el-col>
            </el-row>
            <el-table :data="notreList" class="mt10" :row-class-name="exceptName">
                <el-table-column property="pedesc" label="不予续保内容">
                    <template slot-scope="scope">
                        <el-input  v-model="scope.row.notedesc05" readonly disabled></el-input>
                    </template>
                </el-table-column>
            </el-table>
            <span slot="footer" class="dialog-footer">
            <el-button type="primary" v-if="!btnDisable" @click="saveNotre">确 定</el-button>
            <el-button @click="nrFlag = false">返 回</el-button>
           </span>
        </el-dialog>

    </div>
</template>
<script>
  import img1 from '@/assets/img/p1.png';
  import logo from '@/assets/img/Logo_mianxx.png';
  import constant from '@/utils/constant';
  import uwconstant from '@/utils/uwConstants';
  import uwJs from '@/utils/effect';
  import appName from '@/api/appName';
  import {flag01Pipe} from '@/pipe/comPipe';
  import InsuranceRecords from '@/page/underwriting/renewalManage/insuranceRecords';
  import suspendNav from '@/page/underwriting/renewalManage/suspendNav';
  import coreExtraction from '@/page/underwriting/renewalManage/coreExtraction';
  import accumulatedPremium from './accumulatedPremium';
  import claimsRecords from './claimsRecords';
  import keepRecord from './keepRecord';
  import abnormalTold from './abnormalTold';
  import supplementaryTold from './supplementaryTold';
  import medicalReport from './medicalReport';
  import notepad from './notepad';
  import identityCard from './identityCard';
  import reviewOpinion from './reviewOpinion';//续核记录
  import {callEuis006} from "@/api/underwriting/uw";
  import {getToken,setCookie} from '@/utils/auth';
  import {
    findPageByDimSelect,
    findExamReport,
    findPos,
    findHealthReport,
    getChdrnumByClntnum
  } from "@/api/underwriting/uw";
  import {
    claimHistory,
    findContiNucleNoteHistory,
    insureHistory,
    querynotepad,
    checkArchtypeFromEuruByClmnumChdrcoy,
    findDuw0101MClmByRdocnumChksnoChdrnum,
    findDuw0101MClmByChdrcoyChdrnum
  } from "@/api/underwriting/renewal";
  import {listNotepad} from "@/api/underwriting/notepad";
  import {Message, MessageBox} from 'element-ui';
  import store from '@/store';
  import {ImageQuerySearch} from "@/api/taskCenter/taskCommon";
  import {customerPolicyNos} from "@/api/underwriting/uw";
  import uwLoadJs from '@/utils/uwLoad';
  import { getListNotepadIcd} from "@/api/customermanage/customerManage.js";
  export default {
    data() {
      return {
        insNoteSize:0,
        changeProcFlag:false,
        euruVO: null,
        flag: '',
        getIndex: null,
        getIndex1: null,
        recordFlag: false,
        complainFlag: false,
         coreReasonFlag: false,
        cumAmountFlag: false,
        claimsFlag: false,
        saveDamageFlag: false,
        abnormityFlag: false,
        reportFlag: false,
        consignorFlag: false,
        healthFlag: false,
        notepadFlag: false,
        IDFlag: false,
        reviewFlag: false,

        logo: logo,
        pageAttr: [], // 页面点击排序
        componentId: '',
        paginations: {
          total: 0,        // 总数
          pageIndex: 1,  // 当前位于哪页
          pageSize: 10,   // 1页显示多少条
          pageSizes: [5, 10, 15, 20],  //每页显示多少条
          layout: "total, sizes, prev, pager, next, jumper",   // 翻页属性
          pndesc: "",
          pntype: "4"
        },
        pnIndex: "",
        gobalEle: null,
        gobalExc: null,
        insTabInfo: {//被保人头部信息
          insHistorys: [],//投保历史
          insNotepads: [],//notepad
          insPoss: [],//保全记录
          insClaims: [],//理赔记录
          insRenews: [],//续核记录
          insHealths: [],//异常告知
          insExams: [],//体检告知
          insSupplements: [],//补充告知
          insComplaints: [],//客户投诉记录
          insCoreReasons:[],//提核原因
          clntnum:"",
          name:"",
        },
        isInsHistorys: false,//投保历史
        isInsNotepads: false,//notepad
        isInsPoss: false,//保全记录
        isInsClaims: false,//理赔历史
        isInsRenews: false,//续核记录
        isInsHealths: false,//异常告知
        isInsExams: false,//体检告知
        isInsSupplements: false,//补充告知
        isInsComplaints: false,//客户投诉记录
        isAppHistorys: false,//投保历史
        isAppNotepads: false,//notepad
        isAppPoss: false,//保全记录
        isAppClaims: false,//理赔历史
        isAppRenews: false,//续核记录
        isAppHealths: false,//异常告知
        isAppExams: false,//体检告知
        isAppSupplements: false,//补充告知
        isAppComplaints: false,//客户投诉记录
        isCoreReason: false,//提核原因

        eurg: {},//核保意见对象
        bmntdesc: "",//核保意见
        lda_date: "",//系统当前时间
        curTime: "",//记录时间标志
        userId: "",//当前用户ID
        pageData: {
          "dto":{"flag06":""}
        }, //当前页面初始数据
        clmnum: "", //当前受理号
        subUnLoading: false,
        fullscreenLoading: false,
        btnDisable: false,//禁止操作标志
        eurgs: [],//核保意见
        lockFlag: false,//全局只读
        stateBackFlag: false,//状态回退
        backLoading: false,//状态回退loading
        stateBackControlFlag: false,
        backContinueNucleusControlFlag: false,
        submitNucleusDecideFlag: false,
        mindFlag: false,
        eurgFlag: false,
        eurhs: [],//状态回退列表
        eurh: null,//状态回退
        eurhdesc: "",
        noteTableData: [],
        backTouWFlag: false,
        backToUwDatas: [],//退回续核
        backToUwData: {
          notedesc: "",
          userid: "",
          effdate: "",
        },
        addCostFlag: false,//加费
        apLoading: false,
        premiumTempList: [],//加费明细
        premiumTempVO: {},//加费信息
        curAddPremObj: {},//加费信息
        isAppltype: "",
        ii_pcestrm: 0,
        opcdaSelect: uwconstant.opcdaSelect,//加费类别
        isPremiumCalc: false,//加费试算
        isPremiumAdd: false,//加费新增
        isPremiumDel: false,//加费删除
        isHiTr: false,
        isPrtTr: false,
        zlinstpremTotal:0,
        cwFlag:false,//除外
        cwLoading: false,
        pncodeFlag: false,//照会弹窗
        tbloading: false,
        pnCodes:[],
        postilTempVO:{},//除外信息
        postilTempList:[],//除外列表
        nrFlag:false,//不予续保
        nrLoading:false,
        notreVO:{},
        notreList:[],
        options:[
          {label:"是",value:"Y"},
          {label:"否",value:"N"}
        ],
        eubaList: [],//照会信息
        eubaTempList: [],
        curCrtable:{},//当前险种信息
        option:"", //1 核决，2退回续核 3.状态回退 4.核发信件
        trectyp:"",
        isOpen: false,
        readonly:"",
          doUwClickSetTimeout:null,
          onChangeFlag01SetTimeout:null,
          notRenewSetTimeout:null,
          changeNotreSetTimeout:null,
          postilSetTimeout:null,
          savePostilSetTimeout:null,
          backSetTimeout:null,
          backNulSetTimeout:null,
          doSaveSetTimeout:null,
          addCostSetTimeout:null,
          calcClickSetTimeout:null,
          addPremSureSetTimeout:null,
      }
    },
    components: {
      "insurance-records": InsuranceRecords,
      "suspend-nav": suspendNav,
      'core-extraction': coreExtraction,//提核原因组件
      "accumulated-premium": accumulatedPremium,
      "claims-records": claimsRecords,
      "keep-record": keepRecord,

      "abnormal-told": abnormalTold,
      "supplementary-told": supplementaryTold,
      // "continuation-record": continuationRecord,
      "medical-report": medicalReport,
      "notepad": notepad,
      "identity-card": identityCard,
      "review-opinion": reviewOpinion,//续核记录
    },
    mounted() {
        document.addEventListener('click', this.clickEvent)
    },
    methods: {
        clickEvent(e) {
            let excflag = this.isChild(e.target, this.$(this.gobalExc)[0]);
            let flag = this.isChild(e.target, this.$(this.gobalEle)[0]);
            if (!(this.isChild(e.target, this.$('.select-main')[0])) && !flag) {
                this.opinionDialogVisible8 = false;
            }
            if (!(this.isChild(e.target, this.$('.except-main')[0])) && !excflag) {
                this.pncodeFlag = false;
            }
        },
      //处理码向上聚焦
      procflgUpKey( data) {
        let procflg = "procflg" + (Number(data.index) - 1);
        let i = (Number(data.index) - 1);
        if(i<0){
          return false;
        }
        console.log(this.$refs[procflg])
        this.$nextTick(() => {
          console.log(this.$refs[procflg])
          this.$refs[procflg].focus();
          console.log(this.$refs[procflg])
        },100)
      },
      //处理码向下聚焦
      procflgDownKey( data) {
        let procflg = "procflg" + (Number(data.index) + 1);
        let i = (Number(data.index) + 1);
        if(i>= this.eubaList.length){
          return false;
        }
        // let p = this.$refs[procflg];
        this.$nextTick(() => {
          console.log(this.$refs[procflg])
          this.$refs[procflg].focus();
          console.log(this.$refs[procflg])
        },100)
      },

      // 判断当前元素是否为某元素的子元素
      isChild(e, parent) {
        while (e != undefined && e != null && e.tagName.toUpperCase() != 'BODY') {
          if (e == parent) {
            return true;
          }
          e = e.parentNode;
        }
        return false;
      },

      // 切换主tab
      handleClick() {

      },

      checkTrectyp(){
        if(this.pageData.dto.trectyp == "7"
        || this.pageData.dto.trectyp == "9"
        || this.pageData.dto.trectyp == "A"
         || this.pageData.dto.trectyp == "B"){
            return false;
        }
        return true;
      },

      // 显示子模块
      showItem(index) {
        console.log(index)
        if (index == 0) {
          // 累计保额
          this.cumAmountFlag = true;
        } else if (index == 1) {
            // 提核原因
          if(this.euruVO.archtype!="2" && this.euruVO.archtype!="4"){
            this.alertMsg("注意：只有抽档类型为2.CLM提起核保或4.人工抽查核保才可以看提核意见!","info")
          }else{
            this.coreReasonFlag = true;
          }

        } else if (index == 2) {
          // 理赔历史
          // if(this.pageData.clmHistoryButtonControl=='0'){
          //   this.alertMsg("您暂无查看理赔历史权限")
          // }else{
            this.claimsFlag = true;
          // }


        } else if (index == 3) {
          // 投保记录
          this.recordFlag = true;
        } else if (index == 4) {
          // NotePad
          this.notepadFlag = true;
        } else if (index == 5) {
          // 保全记录
          if( this.pageData.countBaoFuChange=='0'){
            this.alertMsg("您暂无查看保全记录权限")
          }else{
            this.saveDamageFlag = true;
          }

        } else if (index == 6) {
          // 续核记录
          this.reviewFlag = true;
        } else if (index == 7) {
          // 异常告知一览
          this.abnormityFlag = true;
        } else if (index == 8) {
          // 体检报告一览
          this.healthFlag = true;
        } else if (index == 9) {
          // 补充告知一览
          this.reportFlag = true;
        }
        // 页面重新排序
        this.pageSort(index);

      },

      // 页面重新排序
      pageSort(pageIndex) {
        this.pageAttr.push(pageIndex);
        //去重
        let attr = [];
        let obj = {};
        for (let i of this.pageAttr) {
          if (!obj[i]) {
            attr.push(i);
            obj[i] = true;
          }
        }
        console.log(attr);
        this.pageAttr = attr;

        this.componentId = 'insurance-records';
        // this.recordFlag = true;

      },

      showLoading( e){
        this.subUnLoading = e;
      },

      doLogin(xhr){
        if(xhr.status=="401"){

          MessageBox.confirm('您登录已失效，可以取消继续留在该页面，或者重新登录', '确定登出', {
            confirmButtonText: '重新登录',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            store.dispatch('LogOut', {});
            // location.reload();// 为了重新实例化vue-router对象 避免bug
            // window.location.href='http://128.232.11.204:30024/IPAS/index/nb/login'
            window.sessionStorage.setItem('tagActive','')
            // let loginUrl =  window.location.protocol + window.location.host;
            // console.log(loginUrl);
            window.location.href= constant.loginUrl;
          });
        }else{
          Message({
            message: '系统异常',
            type: 'error',
            duration: 5 * 1000
          });
        }

      },

      doUwClick() {
        let that = this;
        that.subUnLoading = true;

        this.doUwClickSetTimeout = setTimeout(function () {
          let params = {
            "clmnum": that.clmnum
          }

          that.$.ajax({
            headers: {
              Authorization: getToken(constant.TOKEN) || ''
            },
            url: appName.GIVENUNDR + '/renewal/renewal/queryRenewalInfo',//url路径
            type: 'POST', //GET
            async: false, //或false,是否异步
            data: JSON.stringify(params),
            contentType: "application/json;charset=UTF-8",
            success: function (res, textStatus, jqXHR) {
              if (res.resultMsg) {
                that.alertMsg(res.resultMsg, "info");
              }
              if (res.resultCode == constant.SUCCESS && res.data != null) {
                that.pageData = res.data;
                that.init();
                that.trectyp = that.pageData.dto.flag01;

                that.eubaList = that.pageData.eubaList
                let i =0;
                that.eubaList.forEach(euba=>{
                  console.log("判断是否可编辑照会rprntdate="+euba.rprntdate+",crtuser="+euba.crtuser);
                  if(Number(euba.rprntdate)>0 || euba.crtuser!=that.userId){
                    euba['isEdit'] = false;
                  }else{
                    euba['isEdit'] = true;
                  }
                  euba['index'] = i;
                  euba['oldProcflg'] = euba.procflg;
                  i++;
                })
                that.eubaTempList = that.pageData.eubaList;
                that.isOpen = true;
                that.$store.dispatch('loading/CHANGE_IS_XQ_OPEN', that.clmnum);

              }else{
                that.$router.go(-1);
              }
              console.log(that.pageData);

            },
            error: function (xhr, textStatus, errorThrown) {
              that.doLogin(xhr);
            }
        })
          that.subUnLoading = false;
          that.initHeadInfo();
        }, 1000);
      },

      init() {
        let that = this;
        that.userId = that.pageData.loginUserid;
        //初始化核保意见
        that.initInsureOpinion();
        that.initFlag();

        //页面的按钮控制
        console.log("789AB flag01Int>=0 判断页面是否可操作："+that.pageData.flag01Int)
        if (Number(that.pageData.flag01Int) >= 0) {
          that.btnDisable = true
          that.wfObjectEnable(false);
        }
        //保服变更按钮控制
        if (Number(that.pageData.countBaoFuChange) == 0) {

        }
        //理赔历史按钮的控制
        if (Number(that.pageData.clmHistoryButtonControl) == 0) {

        }

        //锁所有的控件
        if (that.pageData.lockFlag != undefined && that.pageData.lockFlag == "Y") {
          that.lockFlag = true;
        }

        if (that.pageData.dto.occdate != null && that.pageData.dto.occdate != undefined) {
          if (Number(that.pageData.dto.occdate) > Number(that.pageData.glBusinessDate)) {
            that.alertMsg("请注意，保单的RCD:" + that.pageData.dto.occdate + "大于目前的日期!", "warning")
          }
        }

        //删除加费临时表
        that.deleteAndInsertEuteTmp();



        if(this.readonly!="" && this.readonly=="Y"){
          that.btnDisable = true;
        }

      },

      initFlag(){
          // 累计保额
        this.cumAmountFlag = false;
        this.coreReasonFlag = false;
        this.claimsFlag = false;

          // 投保记录
          this.recordFlag = false;
          // NotePad
          this.notepadFlag = false;
            this.saveDamageFlag = false;

          // 续核记录
          this.reviewFlag = false;
          // 异常告知一览
          this.abnormityFlag = false;
          // 体检报告一览
          this.healthFlag = false;
          // 补充告知一览
          this.reportFlag = false;
      },

      wfObjectEnable(obj) {
        let li_protect;//为0可编辑，为1不可编辑
        let disabled = "";
        if (obj) {
          li_protect = 0;
        } else {
          li_protect = 1;
        }
        //投保计划列表的 续核结论编辑控制
        if (li_protect == 1) {
          this.mindFlag = true;
        }
        if (!obj) {
          //核保意见的增加、删除、更新按钮
          this.eurgFlag = true;

          this.stateBackControlFlag = true;//状态退回
          this.backContinueNucleusControlFlag = true;//退回续核
          this.submitNucleusDecideFlag = true;//提交核决
        }

      },

      //删除加费临时表
      deleteAndInsertEuteTmp() {
        let that = this;
        let params = {
          "clmnum": that.clmnum,
          "clntnum": that.pageData.dto.clntnum,
          "userId": that.userId,
        }
        that.subUnLoading = true;
        that.$.ajax({
          headers: {
            Authorization: getToken(constant.TOKEN) || ''
          },
          url: appName.GIVENUNDR + '/renewal/renewalNucleusUpdate/deleteAndInsertEuteTmp',//url路径
          type: 'POST', //GET
          async: false, //或false,是否异步
          data: JSON.stringify(params),
          contentType: "application/json;charset=UTF-8",
          success: function (res, textStatus, jqXHR) {
            if (res.resultCode == constant.SUCCESS) {
              //that.alertMsg(res.resultMsg, "success");
            }
            that.subUnLoading = false;
          },
          error: function (xhr, textStatus, errorThrown) {
            that.doLogin(xhr);
          }
        })
      },

      //初始化核保意见
      initInsureOpinion() {
        let that = this;
        let params = {
          "aplnum": that.clmnum
        }
        that.$.ajax({
          headers: {
            Authorization: getToken(constant.TOKEN) || ''
          },
          url: appName.GIVENUNDR + '/renewal/renewal/contiNucleNoteHistoryBmntdesc',//url路径
          type: 'POST', //GET
          async: false, //或false,是否异步
          data: JSON.stringify(params),
          contentType: "application/json;charset=UTF-8",
          success: function (res, textStatus, jqXHR) {
            if (res.resultCode == constant.SUCCESS && res.data != null) {
              that.eurgs = res.data;
            }
            console.log(that.eurgs);
          },
          error: function (xhr, textStatus, errorThrown) {
            that.doLogin(xhr);
          }
        })
      },

      //续核结论
      mindOnChane(data) {
            data.modifyFlag = "1";
            data.effdate = data.rerateDate;
      },

      //核发信件
      onChangeFlag01(){
        let that = this;
        let ls_flag06 = that.pageData.dto.flag06;

        if (that.wfCheckUw() == 0) {
          that.alertMsg("错误!!!需要先增加核保意见!!!!!!", "error");
          that.pageData.dto.flag06 = "";
          return false;
        }

        if (!that.checkBeforeSave()) {
          that.alertMsg("请选择续核结论", "warning");
          that.pageData.dto.flag06 = "";
          return false;
        }

        that.subUnLoading = true;
        this.onChangeFlag01SetTimeout = setTimeout(function(){
          if(ls_flag06 =='Y'){
            let count =0;
            let ll_cnt = 0;
            let params1 = {
              "insurnum":that.pageData.dto.chdrnum,
              "pndate":that.pageData.glBusinessDate,
            }
            // that.$.ajax({
            //   headers: {
            //     Authorization: getToken(constant.TOKEN) || ''
            //   },
            //   url: appName.GIVENUNDR + '/renewal/renewalNucleusUpdate/countAfcbByInsurnumPndate',//url路径
            //   type: 'POST', //GET
            //   async: false, //或false,是否异步
            //   data: JSON.stringify(params1),
            //   contentType: "application/json;charset=UTF-8",
            //   success: function (res, textStatus, jqXHR) {
            //     if (res.resultCode == constant.SUCCESS && res.data != null) {
            //       count = res.data;
            //     }
            //   }
            // })
            //
            // if (count > 0 ){
            //   that.alertMsg('今天已经核发过信件并打印，无法再次核发!',"error");
            //   that.subUnLoading = false;
            //   return false;
            // }

            that.$confirm('确定发信件?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              //核发未处理且没有打印日期的照会
              let eubas = [];
              if(that.eubaList && that.eubaList.length>0){
                that.eubaList.forEach(euba=>{
                  if((euba.procflg== undefined || euba.procflg=="") && (Number(euba.rprntdate)==0 && (euba.userid=="" || euba.userid==undefined))){
                    if(euba.crtuser == that.userId){
                      eubas.push(euba);
                    }
                  }
                })
              }
              if(eubas.length==0){
                that.alertMsg("没有需要核发的照会信息","error");
                that.subUnLoading = false;
                that.pageData.dto.flag06 = "";
                return false;
              }

              //查询最大的cnt
              let params2 = {
                "aplnum":that.clmnum,
                "chdrcoy":that.pageData.dto.company,
              }
              that.$.ajax({
                headers: {
                  Authorization: getToken(constant.TOKEN) || ''
                },
                url: appName.GIVENUNDR + '/renewal/renewalNucleusUpdate/findMaxCntFromEurjByAplnumChdrcoy',//url路径
                type: 'POST', //GET
                async: false, //或false,是否异步
                data: JSON.stringify(params2),
                contentType: "application/json;charset=UTF-8",
                success: function (res, textStatus, jqXHR) {
                  if (res.resultCode == constant.SUCCESS && res.data != null) {
                    if(res.data!="" && res.data!="-1"){
                      ll_cnt = Number(res.data)+1;
                    }else if(res.data=="" && res.data!="-1"){
                      ll_cnt = 1;
                    }else{
                      that.alertMsg("错误:提取发信次数出错!","error")
                      that.subUnLoading = false;
                      that.pageData.dto.flag06 = "";
                      return false;
                    }
                  }
                },
                error: function (xhr, textStatus, errorThrown) {
                  that.doLogin(xhr);
                }
              })

              that.option = "4";
              //插入通用核保信件打印记录表eurj
              let params3 = {
                "aplnum":that.clmnum,
                "chdrcoy":that.pageData.dto.company,
                "effdate01":that.pageData.glBusinessDate,
                "chdrnum":that.pageData.dto.chdrnum,
                "userid":that.userId,
                "cnt":ll_cnt,
              }
              that.$.ajax({
                headers: {
                  Authorization: getToken(constant.TOKEN) || ''
                },
                url: appName.GIVENUNDR + '/renewal/renewalNucleusUpdate/insertEurj',//url路径
                type: 'POST', //GET
                async: false, //或false,是否异步
                data: JSON.stringify(params3),
                contentType: "application/json;charset=UTF-8",
                success: function (res, textStatus, jqXHR) {
                  if (res.resultCode == constant.SUCCESS) {
                    that.pageData.dto.trectyp = "5";//照会中
                    that.pageData.dto.flag01 = "5";//照会中
                    that.wfCreateLetter();
                  }else{
                    that.pageData.dto.flag06 = "";
                    that.alertMsg("写入打印记录数据失败!","error");
                  }
                },
                error: function (xhr, textStatus, errorThrown) {
                  that.doLogin(xhr);
                }
              })
            }).catch(() => {
              that.pageData.dto.flag06 = "";
              return false;
            });



          }else{
            this.option = "";
            let params1 = {
              "aplnum":that.clmnum,
              "effdate01":that.pageData.glBusinessDate,
            }
            that.$.ajax({
              headers: {
                Authorization: getToken(constant.TOKEN) || ''
              },
              url: appName.GIVENUNDR + '/renewal/renewalNucleusUpdate/deleteEurjByAplnumEffdate01',//url路径
              type: 'POST', //GET
              async: false, //或false,是否异步
              data: JSON.stringify(params1),
              contentType: "application/json;charset=UTF-8",
              success: function (res, textStatus, jqXHR) {
                if (res.resultCode == constant.SUCCESS) {

                }else{
                  that.alertMsg("刪除当天的打印记录失败!","error")
                }
              },
              error: function (xhr, textStatus, errorThrown) {
                that.doLogin(xhr);
              }
            })
          }
          that.subUnLoading = false;
        },1000);

      },
      //核发信件
      wfCreateLetter(){
        let that = this;

        //核发未处理且没有打印日期的照会
        let eubas = [];
        if(that.eubaList && that.eubaList.length>0){
          that.eubaList.forEach(euba=>{
            if((euba.procflg== undefined || euba.procflg=="") && (Number(euba.rprntdate)==0 && (euba.userid=="" || euba.userid==undefined))){
              if(euba.crtuser == that.userId){
                eubas.push(euba);
              }
            }
          })
        }
        if(eubas.length==0){
          that.alertMsg("没有需要核发的照会信息","error");
          return false;
        }

        if(!that.save(true,false)){
          return false;
        }



        let params = {
          "clmnum": that.clmnum,
          "chdrcoy":that.pageData.dto.company,
          "chdrnum":that.pageData.dto.chdrnum,
          "glBusinessDate":that.pageData.glBusinessDate,
          "eubas":JSON.stringify(eubas),
          "eurds":JSON.stringify(that.pageData.eurdList),
          "userId":that.userId
        }
        that.$.ajax({
          headers: {
            Authorization: getToken(constant.TOKEN) || ''
          },
          url: appName.GIVENUNDR + '/renewal/renewalNucleusUpdate/wfCreateLetter',//url路径
          type: 'POST', //GET
          async: false, //或false,是否异步
          data: JSON.stringify(params),
          contentType: "application/json;charset=UTF-8",
          success: function (res, textStatus, jqXHR) {
            if (res.resultCode == constant.SUCCESS){
              if(res.resultMsg && res.resultMsg!=""){
                that.alertMsg(res.resultMsg,"error");
                that.pageData.dto.flag06 ="N";
              }else{
                that.updateTask();
                // that.alertMsg("核发信件成功！","success")
              }
              if(res.data!=null){
                that.eubaList = res.data;
                let i = 0;
                that.eubaList.forEach(euba=>{
                  if(Number(euba.rprntdate)>0 || euba.crtuser!=that.userId){
                    euba['isEdit'] = false;
                  }else{
                    euba['isEdit'] = true;
                  }
                  euba['oldProcflg'] = euba.procflg;
                  euba['index'] = i;
                  i++;
                })
              }
            }else{
              if(res.resultMsg && res.resultMsg!=""){
                that.alertMsg(res.resultMsg,"error");
                that.pageData.dto.flag06 ="N";
              }
            }
          },
          error: function (xhr, textStatus, errorThrown) {
            that.doLogin(xhr);
          }
        })
      },

      //更新任务
      updateTask(){
        let that = this;
        let params = {
          "clmnum": that.clmnum,
          "trectyp": that.pageData.dto.trectyp,
          "option":that.option
        }
        let flag = true;
        that.$.ajax({
          headers: {
            Authorization: getToken(constant.TOKEN) || ''
          },
          url: appName.GIVENUNDR + '/renewal/renewalNucleusUpdate/updateTask',//url路径
          type: 'POST', //GET
          async: false, //或false,是否异步
          data: JSON.stringify(params),
          contentType: "application/json;charset=UTF-8",
          success: function (res, textStatus, jqXHR) {
            if (res.resultCode == constant.SUCCESS){
              if(res.resultMsg){
                that.alertMsg(res.resultMsg, "success");
              }
            }else{
              that.alertMsg(res.resultMsg, "error");
            }
          },
          error: function (xhr, textStatus, errorThrown) {
            that.doLogin(xhr);
          }
        })
      },
      //获取照会
      createLetter(){
        let _that = this;

        let params = {
          "clmnum": this.clmnum,
          "chdrcoy":this.pageData.dto.company,
          "chdrnum":this.pageData.dto.chdrnum,
          "life":this.curCrtable.life,
          "coverage":this.curCrtable.coverage,
          "rider":this.curCrtable.rider,
          "crtable":this.curCrtable.crtable,
          "glBusinessDate":this.pageData.glBusinessDate,
          "userId":this.userId
        }
        let eubas = [];
        _that.$.ajax({
          headers: {
            Authorization: getToken(constant.TOKEN) || ''
          },
          url: appName.GIVENUNDR + '/renewal/renewalNucleusUpdate/createLetter',//url路径
          type: 'POST', //GET
          async: false, //或false,是否异步
          data: JSON.stringify(params),
          contentType: "application/json;charset=UTF-8",
          success: function (res, textStatus, jqXHR) {
            if (res.resultCode == constant.SUCCESS && res.data != null) {
              eubas = res.data;
            }
          },
          error: function (xhr, textStatus, errorThrown) {
            _that.doLogin(xhr);
          }
        })

        if(eubas.length>0){
          let tempList = [];
          let i = 0;
          eubas.forEach(euba=>{
            //判断是否可以修改
            if(Number(euba.rprntdate)>0 || euba.crtuser!=_that.userId){
              euba['isEdit'] = false;
            }else{
              euba['isEdit'] = true;
            }
            euba['oldProcflg'] = euba.procflg;
            euba['index'] = i;
            i++;
            tempList.push(euba);
          })

          _that.eubaList.forEach(euba=>{
            //已打印的，已核发的，本人的,已手工核销的
            if((Number(euba.rprntdate)>0 ||  (euba.userid!="" && euba.userid!=undefined)
              || (euba.procflg!= undefined && euba.procflg!="")
            ) ){
              euba['index'] = i;
              i++;
              tempList.push(euba);
            }
          })


          _that.eubaList = tempList;
        }

      },


      //照会说明长度校验
      triggerInput(data) {
        if (data.pedesc.length > 124) {
          data.pedesc = data.pedesc.substring(0, 124);
          this.$message({
            message: "注意：照会说明过长，系统已自动截取前124个字符，请查看！",
            type: 'error'
          });
        }
      },
      //处理码改变事件
      changeProcflg(data) {
        if (data.procflg != "") {
          data.procflg = data.procflg.toUpperCase();

          if (data.procflg != "O" && data.procflg != "X") {
            this.$message({
              message: "错误：处理码输入错误",
              type: 'error'
            });
            data.procflg = "";
            data.dateend = "";
          }else{
            if(data.userid!=""){
              this.changeProcFlag = true;
              this.pageData.dto.trectyp = "5";//照会中
              this.pageData.dto.flag01 = "5";//照会中
              this.option = "5";
            }
            data.dateend = this.pageData.glBusinessDate;
          }
        }else{
          if(data.userid!=""){
            this.changeProcFlag = true;
            this.pageData.dto.trectyp = this.trectyp;//照会中
            this.pageData.dto.flag01 = this.trectyp;//照会中
            if(this.option == "5"){
              this.option = "";
            }
          }

          data.dateend = "";
        }

        let eubas = [];
        this.eubaList.forEach(item=>{
          if(item.index == data.index){
            eubas.push(data);
          }else{
            eubas.push(item);
          }
        })
        this.eubaList = eubas;
        console.log(this.eubaList)
        },

      alertMsg(message, type) {
        this.$message({
          message: message,
          type: type
        });
      },


      /************************不予续保 BEGIN*************************/
      //不予续保
      notRenew(data) {
        this.curCrtable = data;
        let that = this;
        if (data.mind == "" || (data.mind != "4" && data.mind != "7")) {
          that.alertMsg("续核结论只有不予续保,到期终止保单才可以不予续保!", "warning");
          return false;
        }
        if(!that.checkTrectyp()){
          that.alertMsg("案件状态为：7-送其他部门处理、9-结案、A-撤回、B-结案失败，不可进行不予续保操作!", "warning");
          // return false;
        }else{
          // if (that.wfCheckUw() == 0) {
          //   that.alertMsg("错误!!!需要先增加核保意见!!!!!!", "error")
          //   return false;
          // }
        }
        this.curAddPremObj = data;
        data['surname'] = that.pageData.dto.surname;
        let params = {
          "eurd": JSON.stringify(data),
          "userid":this.userId,
          "type":"3"
        }
        this.notRenewSetTimeout = setTimeout(function(){
          that.$.ajax({
            headers: {
              Authorization: getToken(constant.TOKEN) || ''
            },
            url: appName.GIVENUNDR + '/renewal/postil/initCost',//url路径
            type: 'POST', //GET
            async: false, //或false,是否异步
            data: JSON.stringify(params),
            contentType: "application/json;charset=UTF-8",
            success: function (res, textStatus, jqXHR) {
              if (res.resultCode == constant.SUCCESS && res.data != null) {
                that.notreVO = res.data.postilTempVO;
                that.notreList = res.data.postilTempList;
              }
              that.nrFlag = true;
            },
            error: function (xhr, textStatus, errorThrown) {
              that.doLogin(xhr);
            }
          })
        },1000)
      },

      //确定
      saveNotre(){
        if (this.wfCheckUw() == 0) {
          this.alertMsg("错误!!!需要先增加核保意见!!!!!!", "error")
          return false;
        }
        if(this.notreVO.notedesc04==""){
          this.alertMsg("请输入不予续保原因","error");
          return false;
        }
        if(this.save(true,true)){
          this.nrFlag = false
        }
      },
      //不予续保原因修改
      changeNotre(){
        let that = this;
        if(this.notreVO.notedesc04==""){
          this.alertMsg("请输入不予续保原因","error");
          return false;
        }
        if (that.wfCheckUw() == 0) {
          that.alertMsg("错误!!!需要先增加核保意见!!!!!!", "error")
          return false;
        }
        that.changeRe("");
        let params = {
          "clmnum": this.clmnum,
          "chdrcoy":this.pageData.dto.company,
          "chdrnum":this.pageData.dto.chdrnum,
          "life":this.curCrtable.life,
          "coverage":this.curCrtable.coverage,
          "rider":this.curCrtable.rider,
          "crtable":this.curCrtable.crtable,
          "glBusinessDate":this.pageData.glBusinessDate,
          "aplnum": this.curAddPremObj.clmnum,
          "userId": this.userId,
          "polpln": this.curAddPremObj.polpln,
          "eutepfList":JSON.stringify(this.notreList),
          "notedesc04":this.notreList[0].notedesc04,
          "eurd":JSON.stringify(this.curAddPremObj),
          "postilTempVO":JSON.stringify(this.notreVO)
        }

        that.subUnLoading = true;
        this.changeNotreSetTimeout = setTimeout(function(){
          let euabs = [];
          let base = null;
          that.$.ajax({
            headers: {
              Authorization: getToken(constant.TOKEN) || ''
            },
            url: appName.GIVENUNDR + '/renewal/postil/saveNotre',//url路径
            type: 'POST', //GET
            async: false, //或false,是否异步
            data: JSON.stringify(params),
            contentType: "application/json;charset=UTF-8",
            success: function (res, textStatus, jqXHR) {
              if (res.resultCode == constant.SUCCESS ) {

                //获取内容
                that.callRuwletter(params);
                that.createLetter();
              }else{
                that.$message({
                  message: "保存失败!",
                  type: 'error'
                });
              }
            },
            error: function (xhr, textStatus, errorThrown) {
              that.doLogin(xhr);
            }
          })
          that.subUnLoading = false;
        },1000);
      },
      callRuwletter(params){
        let that = this;
        // if(!that.saveEurts()){
        //   return false;
        // }
        if(!that.save(false,false)){
          return false;
        }

        that.$.ajax({
          headers: {
            Authorization: getToken(constant.TOKEN) || ''
          },
          url: appName.GIVENUNDR + '/renewal/postil/saveNotereAgain',//url路径
          type: 'POST', //GET
          async: false, //或false,是否异步
          data: JSON.stringify(params),
          contentType: "application/json;charset=UTF-8",
          success: function (res, textStatus, jqXHR) {
            if (res.resultCode == constant.SUCCESS && res.data!=null) {
              // that.$message({
              //   message: "保存成功",
              //   type: 'success'
              // });
              that.changeRe(res.data);
            }else{
              that.$message({
                message: "获取内容失败!",
                type: 'error'
              });
            }
          },
          error: function (xhr, textStatus, errorThrown) {
            that.doLogin(xhr);
          }
        })
      },

      //给不予续保内容重新赋值
      changeRe(msg){
        let that = this;
        let lt_time = uwJs.showTime();
        let ll_time1 = lt_time.substring(8, 10) + lt_time.substring(10, 12) + lt_time.substring(12, 14);

        let premiumTemp = {
          checked: false,
          aplnum: this.clmnum,
          chdrnum: this.curAddPremObj.chdrnum,
          clntnum: this.curAddPremObj.clntnum,
          polpln: this.curAddPremObj.polpln,
          rowNum: this.notreList.length,
          datasqnum: this.notreList.length,
          seqnbr: this.notreList.length,
          flag: "NEW",
          remark05: this.curAddPremObj.clntnum,
          agerate: "0",
          chdrcoy: this.curAddPremObj.company,
          life: this.curAddPremObj.life,
          jlife: this.curAddPremObj.jlife,
          coverage: this.curAddPremObj.coverage,
          rider: this.curAddPremObj.rider,
          updateFlag: "N",
          newDateDeleteFlag: "N",
          flag01: "N",
          crtable01: this.curAddPremObj.crtable,
          crtable02: this.curAddPremObj.crtable,
          crtuser: this.userId,
          dtecrt: this.pageData.glBusinessDate,
          crttime: ll_time1,
          jobName: "ILMP",
          userProfile: this.userId,
          datime: this.initTime(),
          opcda: "ME",
          extCessTerm: this.ii_pcestrm,
          insprm: 0,
          oppc: 0,
          zmortpct: 0,
          zlinstprem: 0,
          notedesc01: "",
          notedesc02: "",
          notedesc03: "",
          notedesc04: "",
          notedesc05: msg,
          notecode:""
        }
        if(this.notreList.length>0){
          this.notreList = [];
        }
        this.notreList.push(premiumTemp);
      },
      /************************不予续保 END*************************/

      /************************除外 BEGIN*************************/
      //除外
      postil(data) {
        this.curCrtable = data;
        this.curAddPremObj = data;
        let that = this;
        if (data.mind == "" || (data.mind != "0"
          && data.mind != "7" && data.mind != "6")) {
          that.alertMsg("续核结论只有加费及除外续保、到期终止、除外续保的保单才可以除外!", "warning");
          return false;
        }
        if(!that.checkTrectyp()){
          that.alertMsg("案件状态为：7-送其他部门处理、9-结案、A-撤回、B-结案失败，不可进行除外操作!", "warning");
          // return false;
        }else{
          // if (that.wfCheckUw() == 0) {
          //   that.alertMsg("错误!!!需要先增加核保意见!!!!!!", "error")
          //   return false;
          // }
        }

        data['surname'] = that.pageData.dto.surname;
        let params = {
          "eurd": JSON.stringify(data),
          "userid":this.userId,
          "type":"2"
        }
        this.postilSetTimeout = setTimeout(function(){
          that.$.ajax({
            headers: {
              Authorization: getToken(constant.TOKEN) || ''
            },
            url: appName.GIVENUNDR + '/renewal/postil/initCost',//url路径
            type: 'POST', //GET
            async: false, //或false,是否异步
            data: JSON.stringify(params),
            contentType: "application/json;charset=UTF-8",
            success: function (res, textStatus, jqXHR) {
              if (res.resultCode == constant.SUCCESS && res.data != null) {
                that.postilTempVO = res.data.postilTempVO;
                that.postilTempList = res.data.postilTempList;
              }
              that.cwFlag = true;
            },
            error: function (xhr, textStatus, errorThrown) {
              that.doLogin(xhr);
            }
          })
        },1000)

      },
      //照会码输入自动查询
      layoutAutoComplate1(data) {
        this.paginations.pageIndex = 1;
        this.paginations.pageSize = 10;

        let params = {
          "pageSize": this.paginations.pageSize,
          "pageNumber": this.paginations.pageIndex,
          "pntype": "4",
          "pncode": data.pncode,
          "pedesc": "",
        }
        findPageByDimSelect(params).then(res => {
          if (res.resultCode == constant.SUCCESS && res.data) {
            this.pnCodes = res.data.rows;
            this.paginations.total = res.data.total
          }

        }).catch(err => {
          // this.loading = false;
          console.log(err)
        })
      },
      // 除外弹框
      exceptName({row, rowIndex}) {
        row.index = rowIndex;
      },
      // 点击除外弹框 除外代码
      showExcept(e, index) {
        console.log(e);
        console.log(index);
        // this.$refs['excSelect'+index];
        console.log(this.$refs['excSelect' + index]);
        this.gobalExc = this.$refs['excSelect' + index];
        let offset = this.$(this.$refs['excSelect' + index]).offset();
        console.log(this.$(this.$refs['excSelect' + index]).offset())
        this.pncodeFlag = true;

        this.paginations.pageIndex = 1;  // 当前位于哪页
        this.paginations.pageSize = 10;
        this.paginations.pntype = "4";//批注
        this.paginations.pndesc = "";
        this.pnIndex = index;
        this.searchPncode();

        this.$nextTick(() => {
          this.$('.except-main').offset({
            top: offset.top + 35,
            left: offset.left
          })
        })
      },
      // 照会代码弹框切换页面
      handleCurrentChange(page) {
        this.paginations.pageIndex = page;
        this.searchPncode();
      },
      // 照会代码弹框切换每页数据大小
      handleSizeChange() {
        this.paginations.pageSize = pageSize;
        this.searchPncode();
      },
      //照会码查询
      searchPncode() {
        this.tbloading = true;
        let params = {
          "pageSize": this.paginations.pageSize,
          "pageNumber": this.paginations.pageIndex,
          "pntype": this.paginations.pntype,
          "pncode": "",
          "pedesc": this.paginations.pndesc,
        }
        findPageByDimSelect(params).then(res => {
          if (res.resultCode == constant.SUCCESS && res.data) {
            this.pnCodes = res.data.rows;
            this.paginations.total = res.data.total
          }
          this.tbloading = false;
        }).catch(err => {
          console.log(err)
        })
      },
      //重置照会码查询
      refreshPncode() {
        this.paginations.pndesc = "";
      },
      //选中照会代码
      showPncode1(row, column, event) {
        let flag = false;
        if( row.pncode != ""){
          this.postilTempList.forEach(item=>{
            if(item.notecode == row.pncode){
              flag = true;
            }
          })
        }

        if(flag){
          this.alertMsg("已存在相同除外内容");
          return false;
        }
        this.postilTempList[this.pnIndex].notecode = row.pncode;
        this.postilTempList[this.pnIndex].notedesc03 = row.pedesc;
        // this.postilItemchanged(this.postilTempList[this.pnIndex]);
        this.pncodeFlag = false;
      },
      //新增除外
      addPostil(){
        let that = this;
        // if (that.wfCheckUw() == 0) {
        //   that.alertMsg("错误!!!需要先增加核保意见!!!!!!", "error")
        //   return false;
        // }
        let lt_time = uwJs.showTime();
        let ll_time1 = lt_time.substring(8, 10) + lt_time.substring(10, 12) + lt_time.substring(12, 14);
        this.postilTempList = [];
        let premiumTemp = {
          checked: false,
          aplnum: this.clmnum,
          chdrnum: this.curAddPremObj.chdrnum,
          clntnum: this.curAddPremObj.clntnum,
          polpln: this.curAddPremObj.polpln,
          rowNum: this.postilTempList.length,
          datasqnum: this.postilTempList.length,
          seqnbr: this.postilTempList.length,
          flag: "NEW",
          remark05: this.curAddPremObj.clntnum,
          agerate: "0",
          chdrcoy: this.curAddPremObj.company,
          life: this.curAddPremObj.life,
          jlife: this.curAddPremObj.jlife,
          coverage: this.curAddPremObj.coverage,
          rider: this.curAddPremObj.rider,
          updateFlag: "N",
          newDateDeleteFlag: "N",
          flag01: "N",
          crtable01: this.curAddPremObj.crtable,
          crtable02: this.curAddPremObj.crtable,
          crtuser: this.userId,
          dtecrt: this.pageData.glBusinessDate,
          crttime: ll_time1,
          jobName: uwconstant.jobName,
          userProfile: this.userId,
          datime: this.initTime(),
          opcda: "ME",
          extCessTerm: this.ii_pcestrm,
          insprm: 0,
          oppc: 0,
          zmortpct: 0,
          zlinstprem: 0,
          notedesc01: "",
          notedesc02: "",
          notedesc03: "",
          notedesc04: "",
          notecode:""
        }

        this.postilTempList.push(premiumTemp);
      },
      //删除除外
      delPostil(data) {
        data.checked = true;
        this.postilTempList = this.postilTempList.filter(item => !item.checked);
      },
      //批注内容改变
      postilItemchanged(data) {

      },
      savePostil(){
        let that = this;
        if (that.wfCheckUw() == 0) {
          that.alertMsg("错误!!!需要先增加核保意见!!!!!!", "error")
          return false;
        }
        if(this.postilTempVO.notedesc02=="" || this.postilTempVO.notedesc02==null){
          this.alertMsg("请输入除外原因","error");
          return false;
        }
        this.addPostil();
        let params = {
          "aplnum": this.curAddPremObj.clmnum,
          "userId": this.userId,
          "polpln": this.curAddPremObj.polpln,
          "chdrnum": this.curAddPremObj.chdrnum,
          "eutepfList":JSON.stringify(this.postilTempList),
          "eurd":JSON.stringify(this.curAddPremObj),
          "postilTempVO":JSON.stringify(this.postilTempVO)
        }

        that.subUnLoading = true;
        this.savePostilSetTimeout = setTimeout(function(){
          let euabs = [];
          let base = null;
          that.$.ajax({
            headers: {
              Authorization: getToken(constant.TOKEN) || ''
            },
            url: appName.GIVENUNDR + '/renewal/postil/savePostil',//url路径
            type: 'POST', //GET
            async: false, //或false,是否异步
            data: JSON.stringify(params),
            contentType: "application/json;charset=UTF-8",
            success: function (res, textStatus, jqXHR) {
              if (res.resultCode == constant.SUCCESS ) {
                that.$message({
                  message: "保存成功",
                  type: 'success'
                });

                if(that.save(false,false)){
                  that.createLetter();
                }
                // if(that.saveEurts()){
                //   that.createLetter();
                // }
                that.cwFlag = false;
              }else{
                that.$message({
                  message: "保存失败!",
                  type: 'error'
                });
              }
            },
            error: function (xhr, textStatus, errorThrown) {
              that.doLogin(xhr);
            }
          })
          that.subUnLoading = false;
        },1000);

      },
      /************************除外 END*************************/


      /************************状态回退 BEGIN*************************/
      //状态回退
      back() {
        // this.$router.go(-1);
        let that = this;

        if (that.wfCheckUw() == 0 && !that.stateBackControlFlag) {
          that.alertMsg("错误!!!需要先增加核保意见!!!!!!", "error");
          return false;
        }

        this.backSetTimeout = setTimeout(function () {
          let params = {
            "aplnum": that.clmnum
          }
          that.backLoading = true;
          that.$.ajax({
            headers: {
              Authorization: getToken(constant.TOKEN) || ''
            },
            url: appName.GIVENUNDR + '/renewal/stateBack/synchronizeStateBack',//url路径
            type: 'POST', //GET
            async: false, //或false,是否异步
            data: JSON.stringify(params),
            contentType: "application/json;charset=UTF-8",
            success: function (res, textStatus, jqXHR) {
              if (res.resultCode == constant.SUCCESS && res.data != null) {
                that.eurhs = res.data;
                if (that.eurhs.length > 0) {
                  that.eurhs.forEach(item => {
                    item['isOld'] = true;
                  })
                }
              }
              that.backLoading = false;
              that.stateBackFlag = true;
            },
            error: function (xhr, textStatus, errorThrown) {
              that.doLogin(xhr);
            }
          })
        }, 1000);

      },
      backNul() {
        let that = this;
        for(let i= 0;i<that.eurhs.length;i++){
          let item = that.eurhs[i];
          if (item.bmntdesc == "") {
            that.alertMsg("请先输入回退原因", "error");
            return false;
          }
        }

        if(this.eurh == null){
          that.alertMsg("请先输入回退原因", "error");
          return false;
        }

        // if (!that.checkBeforeSave()) {
        //   that.alertMsg("请选择续核结论", "warning");
        //   return false;
        // }

        this.backNulSetTimeout = setTimeout(function () {
          let params = {
            "data": JSON.stringify(that.eurhs)
          }
          that.backLoading = true;
          that.$.ajax({
            headers: {
              Authorization: getToken(constant.TOKEN) || ''
            },
            url: appName.GIVENUNDR + '/renewal/stateBack/updateStateBack',//url路径
            type: 'POST', //GET
            async: false, //或false,是否异步
            data: JSON.stringify(params),
            contentType: "application/json;charset=UTF-8",
            success: function (res, textStatus, jqXHR) {
              if (res.resultCode == constant.SUCCESS) {
                that.stateBackFlag = false;
                that.getIndex1 = null;
                that.eurh = {};
                that.eurhdesc = "";

                let trectyp = that.pageData.dto.trectyp;
                if ('23456CD'.indexOf(trectyp) > -1) {
                  if ('3456CD'.indexOf(trectyp) > -1) {
                    that.pageData.dto.trectyp = "2";//核保
                    that.pageData.dto.flag01 = "2";//核保
                  } else {
                    that.pageData.dto.trectyp = "0";//待处理保单
                    that.pageData.dto.flag01 = "0";//待处理保单
                  }
                  that.option = "3";
                  that.doSave();//整体数据保存
                  that.wfObjectEnable(false);
                }

              } else {
                that.alertMsg(res.resultMsg, "error");
              }
              that.backLoading = false;
            },
            error: function (xhr, textStatus, errorThrown) {
              that.doLogin(xhr);
            }
          })
        }, 1000);
      },
      addStateBack() {
        let trectyp = this.pageData.dto.trectyp;
        let trectypStr = "";
        if ('23456CD'.indexOf(trectyp) > -1) {
          if ('3456CD'.indexOf(trectyp) > -1) {
            if (trectyp == "3") {
              trectypStr = "核发信件退回核保";
            }
            if (trectyp == "4") {
              trectypStr = "出信中退回核保";
            }
            if (trectyp == "5") {
              trectypStr = "照会中退回核保";
            }
            if (trectyp == "6") {
              trectypStr = "照会已回复待处理退回核保";
            }
            if (trectyp == "C") {
              trectypStr = "照会逾期未回复退回核保";
            }
            if (trectyp == "D") {
              trectypStr = "特殊件照会回复待处理退回核保";
            }
          } else {
            trectypStr = "核保退回待处理";
          }
        }else{
          this.alertMsg("该状态不可回退","error")
          return false;
        }
        this.eurhs.forEach(item => {
          item['checked'] = false;
        })
        this.eurh = {
          notedesc: trectypStr,
          bmntdesc: "",
          effdate: this.pageData.glBusinessDate,
          userProfile: this.userId,
          aplnum: this.clmnum,
          seqno: "99",
          userid: this.userId,
          chdrcoy: this.pageData.euru.chdrcoy,
          chdrnum: this.pageData.euru.chdrnum,
          glBusinessDate: this.pageData.glBusinessDate,
          jobName: uwconstant.jobName,
          checked: true,
          isOld: false
        }
        this.eurhs.push(this.eurh);
        console.log(this.eurhs)
      },
      updateStateBack() {
        if (this.eurh['checked'] && this.eurhdesc != "") {
          let isTodayData = false;

          if (this.userId != this.eurh.userProfile) {
            this.$message({
              message: "注意：当前用户" + this.userId + "不可以修改历史记录",
              type: 'error'
            });
            return false;
          } else {
            if (Number(this.eurh.effdate) == Number(this.pageData.glBusinessDate) || Number(this.eurh.effdate) == 0) {
              isTodayData = true;
            }
          }

          if (Number(this.eurh.effdate) >= Number(this.pageData.glBusinessDate) && (!this.eurh['checked']) || !isTodayData) {
            this.$message({
              message: "注意：当前用户" + this.userId + "不可以修改历史记录",
              type: 'error'
            });
            return false;
          }

          if (this.eurhdesc == "") {
            this.alertMsg("请录入回退原因", "error");
            return false;
          }
          this.eurh.bmntdesc = this.eurhdesc.trim();
        } else {
          this.$message({
            message: "请选择一行数据",
            type: 'error'
          });
        }
      },
      delStateBack() {
        if (this.eurh['checked']) {

          if (this.userId != this.eurh.userProfile) {
            this.$message({
              message: "注意：当前用户" + this.userId + "没有权限删除历史记录",
              type: 'error'
            });
            return false;
          } else {
            if (Number(this.eurh.effdate) != Number(this.pageData.glBusinessDate) && Number(this.eurh.effdate) != 0) {
              this.$message({
                message: "注意：当前用户" + this.userId + "不可以删除历史记录",
                type: 'error'
              });
              return false;
            }
          }

          if (this.eurh.isOld == true) {
            this.alertMsg("已存档的回退原因不允许删除!", "error");
            return false;
          }

          //移除选定对象
          this.eurhs = this.eurhs.filter(item => !item['checked']);
          this.eurh = {};
        } else {
          this.$message({
            message: "请选择一行数据",
            type: 'error'
          });
        }
      },
      // 点击某行背景改变开始
      tableRowClassName1({row, rowIndex}) {
        row.index = rowIndex;
      },
      selectHeight1({row, rowIndex}) {
        if (this.getIndex1 == rowIndex) {
          return {
            "background-color": "#CAE1FF"
          }
        }
      },
      //点击核保意见，展示意见详细信息
      showDesc1(row, column, event) {
        console.log(row);
        console.log(column);
        this.getIndex1 = column.index;
        row.forEach(item => {
          item['checked'] = false;
        })
        this.eurhdesc = column.bmntdesc.trim();
        this.eurh = column;
        this.eurh['checked'] = true;
      },
      /************************状态回退 END***************************/


      /************************退回续核 BEGIN***************************/

      backToUw() {
        let that = this;
        if (that.checkCrtableIsTableEulipf()) {
          that.alertMsg("主险属于eulipf的打包产品，则必须所有险种的续核结论均为不予续保或到期终止", "error")
          return false;
        }

        if (that.wfCheckUw() == 0) {
          that.alertMsg("错误!!!需要先增加核保意见!!!!!!", "error")
          return false;
        }

        this.backToUwDatas = [];
        this.backToUwDatas.push(this.backToUwData);
        this.backTouWFlag = true;
      },
      modifyDesc(data) {
        if (data.notedesc != "") {
          data.userid = this.userId;
          data.effdate = this.pageData.glBusinessDate;
        }
      },
      backNu2() {
        let trectyp = this.pageData.dto.trectyp;
        if (trectyp == '9') {
          this.alertMsg("已经结案，不可回退！", "warning");
          return false;
        }
        // if (!this.checkBeforeSave()) {
        //   this.alertMsg("请选择续核结论", "warning");
        //   return false;
        // }
        if (confirm("确认需要退回续核?")) {
          if (this.backToUwDatas[0].notedesc != "") {
            this.pageData.dto.trectyp = "9";//结案
            this.pageData.dto.flag01 = "9";//结案
            this.pageData.dto.examstatus = "3";
            this.pageData.dto.notedesc = this.backToUwDatas[0].notedesc;
            this.option = "2";
            this.doSave();
            this.wfObjectEnable(false);

            this.backTouWFlag = false;
          } else {
            this.alertMsg("请先输入退回原因!", "error");
          }
        }
      },
      /************************退回续核 END***************************/

      //校验续核结论是否全选
      checkBeforeSave(){
        for (let i = 0; i < this.pageData.eurdList.length; i++){
          let eurd = this.pageData.eurdList[i];
          if(eurd.mind == ""){
            if(eurd.t3640 == '1' && (eurd.statcode == 'IF' || eurd.statcode == 'PH')){
              return false;
            }
          }
        }
        return true;
      },

      //提交核决
      subNucleusDecide() {
        let ls_mind_2;
        let ls_mind_1;
        let minds = [];
        for(let i=0;i<this.eubaList.length;i++){
          if(this.eubaList[i].procflg==""){
            this.alertMsg("尚有照会信息没有处理完，不能提交核决", "warning");
            return false;
          }
        }

        for (let i = 0; i < this.pageData.eurdList.length; i++) {
          let eurd = this.pageData.eurdList[i];
          if (eurd.mind != "") {
            ls_mind_2 = "Y";
          }
          if (eurd.mind == "0" || eurd.mind == "4" || eurd.mind == "5" || eurd.mind == "6" || eurd.mind == "7") {
            ls_mind_1 = "Y";
            break;
          }
        }
        for (let i = 0; i < this.pageData.eurdList.length; i++) {
          let eurd = this.pageData.eurdList[i];
          if (eurd.mind != "") {
            if(minds.length==0){
              minds.push(eurd.mind);
            }else{
              let mind = minds[0];
              if(mind!=eurd.mind){
                minds.push(eurd.mind);
              }
            }
          }
        }

        if (ls_mind_2 != "Y") {
          this.alertMsg("请选择续核结论", "warning");
          return false;
        }
        if (!this.checkBeforeSave()) {
          this.alertMsg("请选择续核结论", "warning");
          return false;
        }
        console.log(this.trectyp)
        if (confirm("是否确认提交核决?")) {
          if (ls_mind_1 == "Y") {
            this.pageData.dto.trectyp = "7";
            this.pageData.dto.flag01 = "7";
          } else {
            if (ls_mind_2 == "Y") {
              this.pageData.dto.trectyp = "9";
              this.pageData.dto.flag01 = "9";
            }
          }
          this.option = "1";
          //多险种结论不一致，核决成功后状态优先为“送其他部门处理”
          if(minds.length>1){
            this.pageData.dto.trectyp = "7";
            this.pageData.dto.flag01 = "7";
          }

          for (let i = 1; i < this.pageData.eurdList.length; i++) {
            let eurd = this.pageData.eurdList[i];
            this.pageData.dto.examstatus = eurd.mind;
          }


          this.pageData.dto.crtuser = this.userId;
          this.pageData.dto.crtdate = this.pageData.glBusinessDate;
          console.log(this.trectyp)
          this.doSave();//总保存
        }
      },

      //保存
      doSave() {
        let that = this;

        // 当界面续核结论（eurd.mind）为'0','4','5','6'时，要检查界面的核发信件栏位，必须为Y，否则要提示，且不允许提交 start
        let minds = [];
        let eurds =  that.pageData.eurdList;
        for (let i = 0; i < eurds.length; i++) {
            minds.push(eurds[i].mind);
        }
        let flag06 = that.pageData.dto.flag06;
        console.log("euru.flag06:", flag06);
        console.log("eurd.minds",minds);

        if (minds.indexOf("0") !== -1 || minds.indexOf("4") !== -1 || minds.indexOf("5") !== -1 || minds.indexOf("6") !== -1) {
          if (flag06 !== "Y"){
            that.alertMsg("续核结论存在以下结论:'加费及除外续保','不予续保','加费续保','除外续保', 核准选项必须为'是', 请修改", "error")
            return false;
          }
        }
        // 当界面续核结论（eurd.mind）为'0','4','5','6'时，要检查界面的核发信件栏位，必须为Y，否则要提示，且不允许提交 end

        //检查投保计划的主险是否属于eulipf表定义的打包产品
        if (that.checkCrtableIsTableEulipf()) {
          that.alertMsg("主险属于eulipf的打包产品，则必须所有险种的续核结论均为不予续保或到期终止", "error")
          return false;
        }

        if (that.wfCheckUw() == 0) {
          that.alertMsg("错误!!!需要先增加核保意见!!!!!!", "error")
          return false;
        }

        if (!this.checkBeforeSave()) {
          this.alertMsg("请选择续核结论", "warning");
          return false;
        }

        that.subUnLoading = true;
        this.doSaveSetTimeout = setTimeout(function () {
          that.save(true,true);
          that.subUnLoading = false;
        }, 1000);

      },

      save(isSaveEuba,showMsg){
        let that = this;
        if (that.trectyp=="7" || that.trectyp=="9" || that.trectyp=="A" || that.trectyp=="B") {
          that.alertMsg("案件状态为：7-送其他部门处理、9-结案、A-撤回、B-结案失败，不可进行此操作", "error")
          return false;
        }
        let eubas = [];
        if(isSaveEuba){
          eubas = that.eubaList;
        }

        //核销照会信息处理
        let afces = [];
        if(that.eubaList){
          that.eubaList.forEach(item=>{
            if(item.userid != ""){
              if(item.oldProcflg != item.procflg){
                if(item.oldProcflg==""){
                  if(item.procflg=="X"){
                    item['prtopt']="X";
                  }
                }else{
                  if(item.procflg=="X"){
                    item['prtopt']="X";
                  }else{
                    item['prtopt']="Y";
                  }
                }

                afces.push(item);
              }
            }
          })
        }

        let params = {
          "clmnum": that.clmnum,
          "eurc": JSON.stringify(that.pageData.dto),
          "euru": JSON.stringify(that.pageData.euru),
          "eurds": JSON.stringify(that.pageData.eurdList),
          "eurgs": JSON.stringify(that.eurgs),
          "eubas": JSON.stringify(eubas),
          "afces": JSON.stringify(afces),
          "isSaveEuba": isSaveEuba,
          "glBusinessDate": that.pageData.glBusinessDate,
          "option":that.option
        }
        let flag = true;
        that.$.ajax({
          headers: {
            Authorization: getToken(constant.TOKEN) || ''
          },
          url: appName.GIVENUNDR + '/renewal/renewalNucleusUpdate/saveRenewalInfo',//url路径
          type: 'POST', //GET
          async: false, //或false,是否异步
          data: JSON.stringify(params),
          contentType: "application/json;charset=UTF-8",
          success: function (res, textStatus, jqXHR) {

            if (res.resultCode == constant.SUCCESS) {
              if(showMsg){
                that.alertMsg(res.resultMsg, "success");
              }
              if(isSaveEuba && res.data!=null){
                that.eubaList = res.data;
                let i =0;
                that.eubaList.forEach(euba=>{
                  if(Number(euba.rprntdate)>0 || euba.crtuser!=that.userId){
                    euba['isEdit'] = false;
                  }else{
                    euba['isEdit'] = true;
                  }
                  euba['oldProcflg'] = euba.procflg;
                  euba['index'] = i;
                  i++;
                })
              }

              if(that.option!="" && that.option!=null){
                let trectyp = that.pageData.dto.trectyp;
                if ('789AB'.indexOf(trectyp) > -1) {
                  that.btnDisable = true;
                }else if('012'.indexOf(trectyp) > -1) {

                }else if('345D'.indexOf(trectyp) > -1){
                  //原状态为待处理，核保 变成照会中
                  if (that.trectyp == "0" || that.trectyp == "1" || that.trectyp == "2"){
                    // that.btnDisable = true;
                  }
                }else if('6'.indexOf(trectyp) > -1){
                  if (that.trectyp != "6"){
                    that.btnDisable = true;
                  }
                }

              }
            }else{
              flag = false;
              that.alertMsg(res.resultMsg, "error");
            }
          },
          error: function (xhr, textStatus, errorThrown) {
            that.doLogin(xhr);
          }
        })
        return flag;
      },

      //保存续核原因
      saveEurts(){
        let that = this;
        let params = {
          "clmnum": that.clmnum,
          "eurc": JSON.stringify(that.pageData.dto),
          "euru": JSON.stringify(that.pageData.euru),
          "eurds": JSON.stringify(that.pageData.eurdList),
          "userId": that.userId
        }
        let flag = true;
        that.$.ajax({
          headers: {
            Authorization: getToken(constant.TOKEN) || ''
          },
          url: appName.GIVENUNDR + '/renewal/renewalNucleusUpdate/saveEurts',//url路径
          type: 'POST', //GET
          async: false, //或false,是否异步
          data: JSON.stringify(params),
          contentType: "application/json;charset=UTF-8",
          success: function (res, textStatus, jqXHR) {
            that.alertMsg(res.resultMsg, "success");
            if (res.resultCode == constant.SUCCESS) {

            }else{
              flag = false;
            }
          },
          error: function (xhr, textStatus, errorThrown) {
            that.doLogin(xhr);
          }
        })
        return flag;
      },

      //检查投保计划的主险是否属于eulipf表定义的打包产品
      checkCrtableIsTableEulipf() {
        if (Number(this.pageData.crtableIsTableEulipf) > 0) {
          var j = 0;//不予续保
          var k = 0;//到期终止

          for (let i = 0; i < this.pageData.eurdList.length; i++) {
            let mind = this.pageData.eurdList[i].mind;
            //判断不予续保
            if ('4' == mind) {
              j++;
            }
            //判断到期终止
            if ('7' == mind) {
              k++;
            }
          }

          if ((j > 0 && j != length) || (k > 0 && k != length)) {
            return true;//不符合要求
          }
          return false;//符合要求
        } else {
          //非打包产品不做限制
          return false;
        }
      },

      // 变更内容
      contentChange() {
        this.opinionDialogVisible7 = true;
      },


      // 拒保/延期/取消
      conclusionShow() {
        console.log('0-------')
        this.opinionDialogVisible9 = true;
      },

      // 投保计划 险种核保结论
      cuShow() {
        this.opinionDialogVisible10 = true;
      },


      /******************************核保意见BEGIN**************************************/
      // 点击某行背景改变开始
      tableRowClassName({row, rowIndex}) {
        row.index = rowIndex;
      },
      selectHeight({row, rowIndex}) {
        if (this.getIndex == rowIndex) {
          return {
            "background-color": "#CAE1FF"
          }
        }
      },
      //点击核保意见，展示意见详细信息
      showDesc(row, column, event) {
        console.log(row);
        console.log(column);
        this.getIndex = column.index;
        row.forEach(item => {
          item['checked'] = false;
        })
        this.bmntdesc = column.bmntdesc;
        this.eurg = column;
        this.eurg['checked'] = true;
      },

      addEurg() {
        let that = this;

        this.eurgs.forEach(item => {
          item['checked'] = false;
        })
        this.eurg = {
          bmntdesc: "",
          effdate: this.pageData.glBusinessDate,
          userProfile: this.userId,
          jobName: uwconstant.jobName,
          datime: this.initTime(),
          aplnum: this.clmnum,
          seqno: this.eurgs.length - 1,
          chdrcoy: this.pageData.dto.company,
          chdrnum: this.pageData.euru.chdrnum,
          ind: "",
          flag05: "",
          modifyFlag: "N",
          checked: true
        }
        this.eurgs.push(this.eurg);
        this.getIndex = this.eurgs.length - 1;
      },
      editEurg() {
        if (this.eurg['checked'] && this.bmntdesc != "") {
          let isTodayData = false;

          if (this.userId != this.eurg.userProfile) {
            this.$message({
              message: "注意：当前用户" + this.userId + "不可以修改历史记录",
              type: 'error'
            });
            return false;
          } else {
            if (Number(this.eurg.effdate) == Number(this.pageData.glBusinessDate) || Number(this.eurg.effdate) == 0) {
              isTodayData = true;
            }
          }

          if (Number(this.eurg.effdate) >= Number(this.pageData.glBusinessDate) && (!this.eurg['checked']) || !isTodayData) {
            this.$message({
              message: "注意：当前用户" + this.userId + "不可以修改历史记录",
              type: 'error'
            });
            return false;
          }
          this.eurg.bmntdesc = this.bmntdesc.trim();
          this.eurg.effdate = this.pageData.glBusinessDate;

          console.log("核保意见start："+this.pageData.dto.flag01);
          if(this.pageData.dto.flag01=="0" || this.pageData.dto.flag01=="1"){
            this.pageData.dto.trectyp = "2";
            this.pageData.dto.flag01 = "2";
            console.log("核保意见after："+this.pageData.dto.flag01);
          }
        } else {
          this.$message({
            message: "请选择一行数据",
            type: 'error'
          });
        }
      },
      delEurg() {
        if (this.eurg['checked']) {
          if (this.userId != this.eurg.userProfile) {
            this.alertMsg("注意：当前用户" + this.userId + "没有权限删除历史记录", "error");
            return false;
          } else {
            if (Number(this.eurg.effdate) != Number(this.pageData.glBusinessDate) && Number(this.eurg.effdate) != 0) {
              this.alertMsg("注意：当前用户" + this.userId + "不可以删除历史记录", "error");
              return false;
            }
          }

          //移除选定对象
          this.eurgs = this.eurgs.filter(item => !item['checked']);
        } else {
          this.alertMsg("请选择一行数据", "error");
        }
      },
      //初始化当前时间
      initTime() {
        let ldt_datime = null;
        let ls_date = this.pageData.glBusinessDate;//当前系统时间
        let lda_date = ls_date.substring(0, 4) + "-" + ls_date.substring(4, 6) + "-" + ls_date.substring(6, 8);
        let lt_time = uwJs.showTime();
        let ll_time = lt_time.substring(8, 10) + ":" + lt_time.substring(10, 12) + ":" + lt_time.substring(12, 14);
        let ll_time1 = lt_time.substring(8, 10) + lt_time.substring(10, 12) + lt_time.substring(12, 14);
        ldt_datime = lda_date + " " + ll_time;
        return ldt_datime;
      },
      //检查核保意见
      wfCheckUw(data) {
        let index = 0;
        this.eurgs.forEach(eurg => {
          let ll_date = Number(eurg.effdate);
          let ls_date = Number(this.pageData.glBusinessDate);
          let userProfile = eurg.userProfile;

          if (ll_date == ls_date && userProfile == this.userId) {
            index++;
          }
          if (userProfile == "") {
            index++;
          }
        })

        if (index > 0) {
          return 1;
        } else {
          return 0;
        }

      },
      /******************************核保意见END************************************/

      /******************************加费 Begin************************************/
      //加费
      addCost(data) {

        this.curCrtable = data;
        this.curAddPremObj = data;
        this.curAddPremObj['is_calc'] = "N";
        if(this.curAddPremObj.crtable=="PHA1" || this.curAddPremObj.crtable=="PHA3"){
          this.isHiTr = true;
        }

        let that = this;
        if (data.mind == "" || (data.mind != "0"
          && data.mind != "5" && data.mind != "6" && data.mind != "7")) {
          that.alertMsg("续核结论只有加费及除外续保、到期终止、加费续保、除外续保的保单才可以加费!", "warning");
          return false;
        }
        if(!that.checkTrectyp()){
          that.alertMsg("案件状态为：7-送其他部门处理、9-结案、A-撤回、B-结案失败，不可进行加费操作!", "warning");
          // return false;
        }else{
          // if (that.wfCheckUw() == 0) {
          //   that.alertMsg("错误!!!需要先增加核保意见!!!!!!", "error")
          //   return false;
          // }
        }


        data['surname'] = that.pageData.dto.surname;
        let params = {
          "eurd": JSON.stringify(data),
          "userid":this.userId,
          "type":"1"
        }
        this.addCostSetTimeout = setTimeout(function(){
          that.$.ajax({
            headers: {
              Authorization: getToken(constant.TOKEN) || ''
            },
            url: appName.GIVENUNDR + '/renewal/addCost/initCost',//url路径
            type: 'POST', //GET
            async: false, //或false,是否异步
            data: JSON.stringify(params),
            contentType: "application/json;charset=UTF-8",
            success: function (res, textStatus, jqXHR) {
              if (res.resultCode == constant.SUCCESS && res.data != null) {
                that.premiumTempVO = res.data.premiumTempVO;
                that.zlinstpremTotal = res.data.zlinstpremTotal;
                if(res.data.premiumTempList){
                  let zmortpctBg = "B";
                  let opcdaBg = "B";
                  let oppcBg = "B";
                  let datas = [];
                  res.data.premiumTempList.forEach(pre=>{
                    if(pre.opcda=='UL'){
                      opcdaBg = "RB";
                      if(pre.oppcEnditFlag){
                        oppcBg = "RF";
                      }
                      if(pre.zmortpctEnditFlag){
                        zmortpctBg = "RF";
                      }
                    }else{
                      if(pre.oppcEnditFlag){
                        oppcBg = "RF";
                      }
                      if(pre.zmortpctEnditFlag){
                        zmortpctBg = "RF";
                      }
                    }
                    pre['zmortpctBg'] = zmortpctBg;
                    pre['oppcBg'] = oppcBg;
                    pre['opcdaBg'] = opcdaBg;

                    datas.push(pre);
                  })
                  that.premiumTempList = datas;
                  console.log(that.premiumTempList)
                }
                that.isAppltype = res.data.isAppltype;
                that.ii_pcestrm = res.data.ii_pcestrm;

                if(res.data.fisrtSeqnbr!="" && res.data.fisrtSeqnbr!=undefined && res.data.fisrtSeqnbr!="-1"){

                }else{
                  // 不存在数据则自动新增
                  that.addClick();
                }
              }
              that.addCostFlag = true;
            },
            error: function (xhr, textStatus, errorThrown) {
              that.doLogin(xhr);
            }
          })
        },1000)
      },

      ////加费类别
      opcdaChange(data) {
        let ls_short = uwJs.space(10);
        let ls_long = uwJs.space(30);
        let ls_rtncd = uwJs.space(1);
        let ls_rtnsts = uwJs.space(4);
        let ls_key = this.curAddPremObj.crtable + data.opcda;
        this.curAddPremObj['is_calc'] = "Y";
        let params = {
          "company": this.pageData.userComp,
          "lsLongdesc": ls_long,
          "lsRtncd": ls_rtncd,
          "lsRtnsts": ls_rtnsts,
          "lsShortdesc": ls_short,
          "lsSrcebus": ls_key,
          "table": "T5657",
        }
        callEuis006(params).then(res => {
          if (res.resultCode == constant.SUCCESS && res.data != null) {
            if (res.data.lsRtncd.trim() != "") {
              this.$message({
                message: "错误：" + res.data.lsRtncd + "   " + res.data.lsRtnsts + "选择加费类别有误",
                type: 'error'
              });
              data.opcda = "";
              return false;
            }
          } else {
            this.$message({
              message: "错误：选择加费类别有误",
              type: 'error'
            });
            data.opcda = "";
            return false;
          }
        }).catch(err => {
          console.log(err)
        });
      },
      //年期
      ext_cess_termChange(data) {
        if (isNaN(data.extCessTerm) == true) {
          data.extCessTerm = 0;
        }

        this.curAddPremObj.is_calc = "Y";
        if (data.extCessTerm == null || data.extCessTerm == "" || Number(data.extCessTerm) == 0) {
          data.extCessTerm = this.curAddPremObj.premCessTerm;
          return false;
        } else {
          if (Number(data.extCessTerm) > Number(this.curAddPremObj.premCessTerm)) {
            this.$message({
              message: "错误:加费年期超过缴费年期",
              type: 'error'
            });
            data.extCessTerm = this.curAddPremObj.premCessTerm;
            return false;
          }
        }
      },
      // 每十万保额加费
      insprmChange(data) {
        if (isNaN(data.insprm) == true) {
          data.insprm = 0;
        }

        this.curAddPremObj.is_calc = "Y";
        if (this.curAddPremObj.cnttype == "SUL") {
          if (Number(data.insprm) != 1 && Number(data.insprm) != 2 && Number(data.insprm) != 3
            && Number(data.insprm) != 4 && Number(data.insprm) != 5) {
            this.$message({
              message: "错误：" + this.curAddPremObj.polpln + "加费等级不存在",
              type: 'error'
            });
            data.insprm = 0;
            return false;
          }
        } else {
          if (this.curAddPremObj.cnttype == "UR2" && Number(data.insprm) == 0) {
            this.curAddPremObj.is_RULTimes = "L";
          }
        }
      },
      //加费百分比
      oppcChange(data) {
        let that = this;
        if (isNaN(data.oppc) == true) {
          data.oppc = 0;
        }

        if (isNaN(data.oppc) == false) {
          if (Number(data.oppc) > 999.99 || Number(data.oppc) <= 0.009 && Number(data.oppc) != 0) {
            that.$message({
              message: "错误： 数值格式输入错误",
              type: 'error'
            });
            data.oppc = 0;
            return false;
          }
          this.curAddPremObj['is_calc'] = "Y";
          let ls_acctype = null;
          let params1 = {
            "crtable": this.curAddPremObj.crtable
          }
          this.$.ajax({
            headers: {
              Authorization: getToken(constant.TOKEN) || ''
            },
            url: appName.GIVENUNDR + '/renewal/addCost/getAcctypeFromEulapfByCrtable',//url路径
            type: 'POST', //GET
            async: false, //或false,是否异步
            data: JSON.stringify(params1),
            contentType: "application/json;charset=UTF-8",
            success: function (res, textStatus, jqXHR) {
              if (res.resultCode == constant.SUCCESS && res.data != null) {
                ls_acctype = res.data;
              }
            },
            error: function (xhr, textStatus, errorThrown) {
              that.doLogin(xhr);
            }
          })

          if (ls_acctype == null) {
            that.$message({
                message: "OPPC输入之产品代码不存在",
                type: 'error'
              });
              data.oppc = 0;
              return false;
          }

          let ls_acctypeold = ls_acctype;
          if (ls_acctype == '0A' ){
            ls_acctype = 'A';
          }else{
            ls_acctype = ls_acctype.trim();
          }


          // 根据核保等级查询信息
          let  ld_rateup=0;
          let	 ls_sublvlind="";
          let  ls_unitind="";
          let params2 = {
            "uwlevel": this.pageData.eufgpkyVO.uwlevel,
            "uwtype": ls_acctype,
          }
          this.$.ajax({
            headers: {
              Authorization: getToken(constant.TOKEN) || ''
            },
            url: appName.GIVENUNDR + '/renewal/addCost/getAgcomrtFlag01Flag02FromEuffpkyByUwlevelUwtype',//url路径
            type: 'POST', //GET
            async: false, //或false,是否异步
            data: JSON.stringify(params2),
            contentType: "application/json;charset=UTF-8",
            success: function (res, textStatus, jqXHR) {
              if (res.resultCode == constant.SUCCESS && res.data != null) {
                ld_rateup=res.data.agcomrt;// 加费频点
                ls_sublvlind=res.data.flag01;// 是否使用二级权限
                ls_unitind=res.data.flag02;// // 单位
              }
            },
            error: function (xhr, textStatus, errorThrown) {
              that.doLogin(xhr);
            }
          })

          if (ls_sublvlind!=""&&ls_sublvlind!='Y' ){
            // read euffpf 使用老的权限管理
            var ld_rate=0;
            ld_rate=fGetRateupRate(this.curAddPremObj.crtable,this.userId);
            if( Number(data.oppc) > ld_rate ){
              that.alertMsg('错误,OPPC加费数值超过权限LEVEL 1' +ld_rate,"error");
              data.oppc = 0;
              return false;
            }
          }

          // 走新的权限管理
          let params3 = {
            applnum :this.clmnum,
            acctypeold : ls_acctypeold,
            unitind : ls_unitind,
            acctype : ls_acctype,
            zmortpct : data.oppc,
            uwlevel : this.pageData.eufgpkyVO.uwlevel,
            clntnum : this.pageData.dto.clntnum
          };
          this.$.ajax({
            headers: {
              Authorization: getToken(constant.TOKEN) || ''
            },
            url: appName.GIVENUNDR + '/renewal/addCost/checkIsAcctypeoldFromDwEu001',//url路径
            type: 'POST', //GET
            async: false, //或false,是否异步
            data: JSON.stringify(params3),
            contentType: "application/json;charset=UTF-8",
            success: function (res, textStatus, jqXHR) {
              if (res.resultCode == constant.SUCCESS && res.data != null && res.data!="") {
                that.alertMsg(res.data,"error");
                data.oppc = 0;
              }
            },
            error: function (xhr, textStatus, errorThrown) {
              that.doLogin(xhr);
            }
          })

        }
      },
      fGetRateupRate(as_crtable, as_userid) {
        let that = this;
        let message = 0;
        let params1 = {
          "crtable": as_crtable,
          "userid": as_userid,
        }
        this.$.ajax({
          headers: {
            Authorization: getToken(constant.TOKEN) || ''
          },
          url: appName.GIVENUNDR + '/renewal/addCost/fGetRateupRate',//url路径
          type: 'POST', //GET
          async: false, //或false,是否异步
          data: JSON.stringify(params1),
          contentType: "application/json;charset=UTF-8",
          success: function (res, textStatus, jqXHR) {
            if (res.resultCode == constant.SUCCESS && res.data != null) {
              message = res.data;
            }
          },
          error: function (xhr, textStatus, errorThrown) {
            that.doLogin(xhr);
          }
        })

        return message;
      },
      zmortpctChange(data) {
        let that = this;
        let ls_acctype=null;
        if (isNaN(data.zmortpct) == true) {
          data.zmortpct = 0;
          return false;
        }
        this.curAddPremObj['is_calc'] = "Y";
        let params1 = {
          "crtable": this.curAddPremObj.crtable
        }
        this.$.ajax({
          headers: {
            Authorization: getToken(constant.TOKEN) || ''
          },
          url: appName.GIVENUNDR + '/renewal/addCost/getAcctypeFromEulapfByCrtable',//url路径
          type: 'POST', //GET
          async: false, //或false,是否异步
          data: JSON.stringify(params1),
          contentType: "application/json;charset=UTF-8",
          success: function (res, textStatus, jqXHR) {
            if (res.resultCode == constant.SUCCESS && res.data != null) {
              ls_acctype = res.data;
            }
          },
          error: function (xhr, textStatus, errorThrown) {
            that.doLogin(xhr);
          }
        })

        let ls_acctypeold = ls_acctype;
        if (ls_acctype == '0A' ){
          ls_acctype = 'A';
        }else{
          if(ls_acctype!=null){
            ls_acctype = ls_acctype.trim();
          }
        }


        // 根据核保等级查询信息
        let  ld_rateup=0;
        let	 ls_sublvlind="";
        let  ls_unitind="";
        let params2 = {
          "uwlevel": this.pageData.eufgpkyVO.uwlevel,
          "uwtype": ls_acctype,
        }
        this.$.ajax({
          headers: {
            Authorization: getToken(constant.TOKEN) || ''
          },
          url: appName.GIVENUNDR + '/renewal/addCost/getAgcomrtFlag01Flag02FromEuffpkyByUwlevelUwtype',//url路径
          type: 'POST', //GET
          async: false, //或false,是否异步
          data: JSON.stringify(params2),
          contentType: "application/json;charset=UTF-8",
          success: function (res, textStatus, jqXHR) {
            if (res.resultCode == constant.SUCCESS && res.data != null) {
              ld_rateup=res.data.agcomrt;// 加费频点
              ls_sublvlind=res.data.flag01;// 是否使用二级权限
              ls_unitind=res.data.flag02;// // 单位
            }
          },
          error: function (xhr, textStatus, errorThrown) {
            that.doLogin(xhr);
          }
        })

        if (ls_sublvlind!=""&&ls_sublvlind!='Y' ){
          var ld_rate=0;;
          if( Number(data.zmortpct) > ld_rate ){
            this.alertMsg('错误,加费数值超过权限' +ld_rate,"error");
            data.zmortpct = 0;
            return false;
          }
        }

        // 走新的权限管理
        let params3 = {
          applnum :this.clmnum,
          acctypeold : ls_acctypeold,
          unitind : ls_unitind,
          acctype : ls_acctype,
          zmortpct : data.zmortpct,
          uwlevel : this.pageData.eufgpkyVO.uwlevel,
          clntnum : this.pageData.dto.clntnum
        };
        this.$.ajax({
          headers: {
            Authorization: getToken(constant.TOKEN) || ''
          },
          url: appName.GIVENUNDR + '/renewal/addCost/checkIsAcctypeoldFromDwEu001',//url路径
          type: 'POST', //GET
          async: false, //或false,是否异步
          data: JSON.stringify(params3),
          contentType: "application/json;charset=UTF-8",
          success: function (res, textStatus, jqXHR) {
            if (res.resultCode == constant.SUCCESS && res.data != null) {
              this.alertMsg(res.data,"error");
              data.zmortpct = 0;
            }
          },
          error: function (xhr, textStatus, errorThrown) {
            that.doLogin(xhr);
          }
        })

      },

      //保费试算
      calcClick(){
        let that = this;
        that.subUnLoading = true;
        this.calcClickSetTimeout = setTimeout(function(){
          if (that.curAddPremObj.is_calc =='Y' ){
            let params = {
              "polpln":that.curAddPremObj.crtable,
              "eurc":JSON.stringify(that.pageData.dto),
              "eurd":JSON.stringify(that.pageData.eurdList),
              "eute":JSON.stringify(that.premiumTempList),
            }
            //试算
            let euabs = [];
            let base = null;
            that.$.ajax({
              headers: {
                Authorization: getToken(constant.TOKEN) || ''
              },
              url: appName.GIVENUNDR + '/renewal/premiumCal/calculation',//url路径
              type: 'POST', //GET
              async: false, //或false,是否异步
              data: JSON.stringify(params),
              contentType: "application/json;charset=UTF-8",
              success: function (res, textStatus, jqXHR) {
                if (res.data!=null) {
                  console.log(res.data)
                  let insuerPlanList = res.data.insuerPlanList;
                  let infoList = res.data.infoList;
                  let eutepfVOList = res.data.eutepfVOList;


                  //试算后更改投保计划的 总保费、基本保费、次标保费
                  that.initInsuerPlanList(insuerPlanList);
                  that.changeZlinstprem(eutepfVOList);

                  // 加费试算后的提示信息
                  if (infoList != null && infoList.length>0) {
                    for (var i = 0 ; i < infoList.length ; i++) {
                      if(infoList[i].wfCalPremInfo!="" && infoList[i].wfCalPremInfo!=undefined){
                        that.$message({
                          message: infoList[i].wfCalPremInfo,
                          type: 'success'
                        });
                      }
                    }
                  }

                  // 试算成功后,修改Status为N
                  that.curAddPremObj.is_calc = 'N';

                }else{
                  that.$message({
                    message: "保费计算失败",
                    type: 'error'
                  });
                  return false;
                }
              },
              error: function (xhr, textStatus, errorThrown) {
                that.doLogin(xhr);
              }
            })

          }
          that.subUnLoading = false;
        },1000)
      },

      //试算后更改投保计划的 总保费、基本保费、次标保费
      initInsuerPlanList(insuerPlanList){
        if(insuerPlanList!=null && insuerPlanList.length>0){
            this.pageData.eurdList.forEach(eurd=>{
              insuerPlanList.forEach(item=>{
                if(eurd.crtable == item.crtable){
                  eurd.zbinstprem=item.zbinstprem;// 基本保费
                  eurd.instprem=item.instprem;// 总保费
                  eurd.zlinstprem=item.zlinstprem;// 次标保费

                  // WP或PB险种（投保计划表EURDSTM的险种类别为‘01’，试算后则重新计算‘保额/计划’的值），当系统进行试算操作时，需自动重新计算此类险种的保额及保费
                  if(item.acctype=='01'){
                    eurd.sumins= item.sumins;
                  }
                }
              })


            })
        }
      },

      // 试算后更改加费得次标保费
      changeZlinstprem(eutepfVOList){
        if(eutepfVOList!=null && eutepfVOList.length>0){
           let total = 0;
            this.premiumTempList.forEach(pre=>{
              eutepfVOList.forEach(item=>{
                if(pre.seqnbr == item.seqnbr && this.curAddPremObj.polpln == item.polpln){
                  pre.zlinstprem = item.zlinstprem;
                  total = Number(total)+ Number(item.zlinstprem);
                }
              })
            })
          this.zlinstpremTotal = total;
        }
      },

      addPremSure(){
        let that = this;
        if (that.wfCheckUw() == 0) {
          that.alertMsg("错误!!!需要先增加核保意见!!!!!!", "error")
          return false;
        }
        if(this.premiumTempVO.notedesc01=="" || this.premiumTempVO.notedesc01==null){
          this.alertMsg("请输入加费原因","error");
          return false;
        }

        if(!this.premiumTempVO.phi){
          this.premiumTempVO.phi = 0;
        }
        if(!this.premiumTempVO.pwp){
          this.premiumTempVO.pwp = 0;
        }
        if(!this.premiumTempVO.prt){
          this.premiumTempVO.prt = 0;
        }
        let params = {
          "aplnum": this.curAddPremObj.clmnum,
          "userId": this.userId,
          "polpln": this.curAddPremObj.polpln,
          "chdrnum": this.curAddPremObj.chdrnum,
          "eutepfList":JSON.stringify(this.premiumTempList),
          "eurd":JSON.stringify(this.curAddPremObj),
          "premiumTempVO":JSON.stringify(this.premiumTempVO)
        }

        that.subUnLoading = true;
        this.addPremSureSetTimeout = setTimeout(function(){
          let euabs = [];
          let base = null;
          that.$.ajax({
            headers: {
              Authorization: getToken(constant.TOKEN) || ''
            },
            url: appName.GIVENUNDR + '/renewal/addCost/savePremium',//url路径
            type: 'POST', //GET
            async: false, //或false,是否异步
            data: JSON.stringify(params),
            contentType: "application/json;charset=UTF-8",
            success: function (res, textStatus, jqXHR) {
              if (res.resultCode == constant.SUCCESS ) {
                that.$message({
                  message: "保存成功",
                  type: 'success'
                });
                // if(that.saveEurts()){
                //   that.createLetter();
                // }
                if(that.save(false)){
                  that.createLetter();
                }
                that.addCostFlag = false;
              }else{
                that.$message({
                  message: "保存失败!",
                  type: 'error'
                });
              }
            },
            error: function (xhr, textStatus, errorThrown) {
              that.doLogin(xhr);
            }
          })
          that.subUnLoading = false;
        },1000);


      },

      //新增加费
      addClick() {
        let that = this;
        if (that.wfCheckUw() == 0) {
          that.alertMsg("错误!!!需要先增加核保意见!!!!!!", "error")
          return false;
        }
        let lt_time = uwJs.showTime();
        let ll_time1 = lt_time.substring(8, 10) + lt_time.substring(10, 12) + lt_time.substring(12, 14);
        if ((this.curAddPremObj.cnttype.trim() == "SUL" || this.curAddPremObj.cnttype.trim() == "RUL") && this.premiumTempList.length > 0) {
          return false;
        }
        if (this.premiumTempList.length > 8) {
          this.$message({
            message: "讯息：次标加费输入不可超过八笔记录",
            type: 'error'
          });
          return false;
        }

        let getopcda = null;
        let getoppc = 0;
        let getinsprm = 0;
        let getzmortpct = 0;
        let params = {
          "chdrcoy": this.curAddPremObj.chdrcoy,
          "chdrnum": this.curAddPremObj.chdrnum,
          "life": this.curAddPremObj.life,
          "coverage": this.curAddPremObj.coverage,
          "rider": this.curAddPremObj.rider,
        }
        that.$.ajax({
          headers: {
            Authorization: getToken(constant.TOKEN) || ''
          },
          url: appName.GIVENUNDR + '/renewal/addCost/addGetOppcInsprmZmortpctOpcdaFromLext',//url路径
          type: 'POST', //GET
          async: false, //或false,是否异步
          data: JSON.stringify(params),
          contentType: "application/json;charset=UTF-8",
          success: function (res, textStatus, jqXHR) {
            if (res.resultCode == constant.SUCCESS && res.data != null) {
              getopcda = res.data.opcda;
              getoppc = res.data.oppc;
              getinsprm = res.data.insprm;
              getzmortpct = res.data.zmortpct;
            }
          },
          error: function (xhr, textStatus, errorThrown) {
            that.doLogin(xhr);
          }
        })

        let oppc = 0;
        if (this.curAddPremObj.polpln.indexOf("PHA") > 0) {
          oppc = this.premiumTempVO.prt;
        }

        let is_Stat_Fund = this.curAddPremObj.statFund;
        let is_crtable = this.curAddPremObj.crtable;

        let zmortpctBg = "B";
        let oppcBg = "B";
        if (is_Stat_Fund == 'M') {
          if (this.isAppltype == '2' || is_crtable == 'SHR1' || is_crtable == 'SHRA' || is_crtable == 'SHRB') {
            zmortpctBg = "RF";
          } else {
            oppcBg = "RF";
          }
        }
        if (is_Stat_Fund == 'R') {
          if (is_crtable == 'SURT' || is_crtable == 'URRT' || is_crtable == 'URGT' || is_crtable == 'UNV1' || is_crtable == 'UVRT' || is_crtable == 'UVGT') {
            oppcBg = "RF";
          } else {
            zmortpctBg = "RF";
          }
        }

        let premiumTemp = {
          checked: false,
          zmortpctBg: zmortpctBg,
          oppcBg: oppcBg,
          aplnum: this.clmnum,
          chdrnum: this.curAddPremObj.chdrnum,
          clntnum: this.curAddPremObj.clntnum,
          polpln: this.curAddPremObj.polpln,
          rowNum: this.premiumTempList.length+1,
          datasqnum: this.premiumTempList.length+1,
          seqnbr: this.premiumTempList.length+1,
          flag: "NEW",
          remark05: this.curAddPremObj.clntnum,
          agerate: "0",
          chdrcoy: this.curAddPremObj.company,
          life: this.curAddPremObj.life,
          jlife: this.curAddPremObj.jlife,
          coverage: this.curAddPremObj.coverage,
          rider: this.curAddPremObj.rider,
          updateFlag: "N",
          newDateDeleteFlag: "N",
          flag01: "N",
          crtable01: this.curAddPremObj.crtable,
          crtable02: this.curAddPremObj.crtable,
          crtuser: this.userId,
          dtecrt: this.pageData.glBusinessDate,
          crttime: ll_time1,
          jobName: uwconstant.jobName,
          userProfile: this.userId,
          datime: this.initTime(),
          opcda: "ME",
          extCessTerm: this.ii_pcestrm,
          insprm: getinsprm,
          oppc: getoppc,
          zmortpct: getzmortpct,
          zlinstprem: 0,
          notedesc01: "",
          notedesc02: "",
          notedesc03: "",
          notedesc04: "",
        }

        this.premiumTempList.push(premiumTemp);
        this.curAddPremObj.is_calc = "Y";

        console.log(this.premiumTempList)
      },

      //删除加费
      delClick(data) {
        data.checked = true;
        this.premiumTempList = this.premiumTempList.filter(item => !item.checked);
        this.curAddPremObj.is_calc = "Y";

        let total = 0;
        this.premiumTempList.forEach(pre=>{
          total = Number(total)+ Number(item.zlinstprem);
        })
        this.zlinstpremTotal = total;
      },
      /***************************加费 END**********************************************/

      //初始化头部列表信息
      initHeadInfo() {
        let that = this;

        //投保历史
        // setTimeout(function()  {
            that.initInsureHistory();
        // }, 1000);

        //notepad
        // setTimeout(function()  {
          that.initNotepad();
        // }, 1000);

        // //保全记录
        // setTimeout(function()  {
          that.initPoss();
        // }, 1000);

        //理赔记录
        // setTimeout(function()  {
          that.initClaims();
        // }, 1000);

        // //续核记录
        // setTimeout(function()  {
          that.initRenews();
        // }, 1000);

        // //异常告知
        // setTimeout(function()  {
          that.initHealths();
        // }, 1000);

        // // //体检告知
        // setTimeout(function()  {
          that.initExams();
        // }, 1000);
        // 提核原因
        // setTimeout(function()  {
          that.initSomplains();
        // }, 1000);

        // //补充告知
        // setTimeout(function()  {
          that.initSupplements();
        // }, 1000);
      },

      /**
       * 初始化notepad
       * @param type
       * @param data
       */
      initNotepad() {

        let params = {
          "pageSize": 1000,
          "pageNumber": 1,
          "clntnum": this.pageData.dto.clntnum
        }

        getListNotepadIcd(params).then(res => {
          if (res.resultCode == constant.SUCCESS && res.data.list.length) {
            this.insTabInfo['insNotepads'] = res.data.list;
            this.insNoteSize =res.data.total;

          }
          this.isInsNotepads = true;
        }).catch(err => {
          this.isInsNotepads = true;
        })
      },
      //保全记录
      initPoss() {
        let params = {
          "clntnum": this.pageData.dto.clntnum
        }
        findPos(params).then(res => {
          if (res.resultCode == constant.SUCCESS && res.data != null) {
            let psList = res.data;
              this.insTabInfo['insPoss'] = psList;
          }
            this.isInsPoss = true;
        }).catch(err => {
            this.isInsPoss = true;
        })
      },
      //理赔记录
      initClaims() {
        let params = {
          "pageSize": 10000,
          "pageNumber": 1,
          "policyNo": this.pageData.dto.chdrnum
        }
        claimHistory(params).then(res => {
          if (res.resultCode == constant.SUCCESS && res.data != null) {
            let claimList = res.data.list;
            this.insTabInfo['insClaims'] = claimList;
          }
            this.isInsClaims = true;
        }).catch(err => {
            this.isInsClaims = true;
        })
      },
      //续核记录
      initRenews() {
        this.insTabInfo['insCount'] = 0;
        let params = {
          "pageSize": 10000,
          "pageNumber": 1,
          "clntnum": this.pageData.dto.clntnum //"50168127"
        }
        findContiNucleNoteHistory(params).then(res => {
          if (res.resultCode == constant.SUCCESS && res.data != null) {
            let historys = res.data.list;
            let count = 0;
            for(let i=0;i<historys.length;i++){
              let item = historys[i];
              if(item.clmnumShow!=""){
                count++;
              }
            }

              this.insTabInfo['insRenews'] = historys;
              this.insTabInfo['insCount'] = count;
          }
            this.isInsRenews = true;
        }).catch(err => {
            this.isInsRenews = true;
        })
      },
      //投保记录
      initInsureHistory() {
        this.insTabInfo.insHistorysCount =0;
          let params = {
          "pageSize": 10000,
          "pageNumber": 1,
          "clmnum": this.clmnum //"50168127"
        }
        insureHistory(params).then(res => {
          debugger
          if (res.resultCode == constant.SUCCESS && res.data != null) {
            let historys = res.data.list;
            let count=0;
            let oldchdrnum = "";
            for(let i=0;i<historys.length;i++){
              let item = historys[i];
              if(i==0){
                oldchdrnum = item.chdrnum;
                count++;
              }else{
                if(oldchdrnum!=item.chdrnum){
                  oldchdrnum = item.chdrnum;
                  count++;
                }else{
                }
              }
            }
              this.insTabInfo.insHistorys = historys;
              this.insTabInfo.insHistorysCount = count;
          }
            this.isInsHistorys = true;
        }).catch(err => {
            this.isInsHistorys = true;
        })
      },
      //异常告知
      initHealths() {
        let params = {
          "clntnum": this.pageData.dto.clntnum
        }
        findHealthReport(params).then(res => {
          if (res.resultCode == constant.SUCCESS && res.data != null) {
            let list = res.data;
              this.insTabInfo['insHealths'] = list;
          }
            this.isInsHealths = true;
        }).catch(err => {
            this.isInsHealths = true;
        })
      },
      //体检告知
      initExams() {
       debugger
        let policyNos="";

        let params = {
          "clntnum":this.pageData.dto.clntnum
        }
        getChdrnumByClntnum(params).then(res=>{
          if(res.data!=null){
            if(res.data.length>0){
              res.data.forEach(item=>{
                policyNos = policyNos +item+",";
              })
            }
            if(policyNos.indexOf(",")!=-1){
              policyNos = policyNos.substring(0,policyNos.length-1);
            }

            if(policyNos!=""){
              let doctype = "体检报告单,`体检报告单,门诊病历,其他病历资料,`门诊病历,`其他病历资料,病历资料,承保后调查报告";
              let docType = doctype
              let params1 = {
                "begintime": "",
                "birthday": "",
                "branchCode": "",
                "busiNO":  "",
                "busiType": "NB",
                "comCode": "",
                "docType": docType,
                "doflag": "caseimage",
                "groupNO": "",
                "imgsort": "",
                "imgsortorder1": "",
                "imgsortorder2": "",
                "imgsortorder3": "",
                "insured": "",
                "isNoCaseno": "",
                "isPrint": "",
                "policyer": "",
                "policyNO": policyNos ? policyNos : "",
                "policyno16": "",
                "productType": "",
                "serno": "",
                "stockID": "",
                "sproductType": "",
                "spurview": "query",
                "stype": "general"
              }
              ImageQuerySearch(params1, this.userId, 1000, 1).then(res => {
                if (res.resultCode == constant.SUCCESS && res.resBody) {
                  if (res.strDoFlag == "image" || res.strDoFlag == "caseimage") {
                    let list = res.resBody.imageList;
                    this.insTabInfo['insExams'] = list;
                  }
                }
              }).catch(err => {

              })
            }
          }
        }).catch(err=>{

        })
        // let url = appName.NEWUNDR + '/unipnd/euab/getChdrnumByClntnum';
        // let res = uwLoadJs.ajaxRequest(params,url);

        this.isInsExams = true;
      },
      //补充告知
      initSupplements() {
        let policyNos="";
        let params = {
          "clntnum":this.pageData.dto.clntnum
        }
        // let url = appName.NEWUNDR + '/unipnd/euab/getChdrnumByClntnum';
        // let res = uwLoadJs.ajaxRequest(params,url);
        getChdrnumByClntnum(params).then(res=>{
          if(res.data!=null){
            if(res.data.length>0){
              res.data.forEach(item=>{
                policyNos = policyNos +item+",";
              })
            }
            if(policyNos.indexOf(",")!=-1){
              policyNos = policyNos.substring(0,policyNos.length-1);
            }
          }

          // policyNos = "02291226";
          if(policyNos!=""){
            let doctype = "新契约告知书,补充告知声明书,`新契约告知书,`补充告知声明书";
            let docType = doctype;
            let params1 = {
              "begintime": "",
              "birthday": "",
              "branchCode": "",
              "busiNO":  "",
              "busiType": "NB",
              "comCode": "",
              "docType": docType,
              "doflag": "caseimage",
              "groupNO": "",
              "imgsort": "",
              "imgsortorder1": "",
              "imgsortorder2": "",
              "imgsortorder3": "",
              "insured": "",
              "isNoCaseno": "",
              "isPrint": "",
              "policyer": "",
              "policyNO": policyNos ? policyNos : "",
              "policyno16": "",
              "productType": "",
              "serno": "",
              "stockID": "",
              "sproductType": "",
              "spurview": "query",
              "stype": "general"
            }
            ImageQuerySearch(params1, this.userId, 1000, 1).then(res => {
              if (res.resultCode == constant.SUCCESS && res.resBody) {
                if (res.strDoFlag == "image" || res.strDoFlag == "caseimage") {
                  this.insTabInfo['insSupplements'] = res.resBody.imageList;
                }
              }
              if (type == 0) {
                this.isInsSupplements = true;
              } else {
                this.isAppSupplements = true;
              }

            }).catch(err => {

            })
          }
        }).catch(err=>{

        })


          this.isAppSupplements = true;


      },
      //提核原因
      initSomplains() {
        let that = this;
        let params = {
          "clmnum": that.clmnum,
          "chdrcoy": that.pageData.dto.company
        }
        checkArchtypeFromEuruByClmnumChdrcoy(params).then(res=>{
          if (res.resultCode == constant.SUCCESS) {
            if(res.data != null){
              that.euruVO = res.data;
            }else{
              that.alertMsg("注意：只有抽档类型为2.CLM提起核保或4.人工抽查核保才可以看提核意见!","info");
            }

            if(that.euruVO!=null && (that.euruVO.archtype=="2" || that.euruVO.archtype=="4")){
              if(that.euruVO.archtype=="2"){
                let params1 = {
                  "rdocnum": that.euruVO.rdocnum,
                  "chdrnum": that.euruVO.chdrnum,
                  "chksno": that.euruVO.chksno
                }
                findDuw0101MClmByRdocnumChksnoChdrnum(params1).then(res1=>{
                  if (res1.resultCode == constant.SUCCESS && res1.data != null) {
                    let list = res1.data;
                    that.insTabInfo.insCoreReasons = list;
                  }
                  that.isCoreReason = true;
                }).catch(err=>{

                })

              }else{
                let params1 = {
                  "chdrcoy": that.pageData.dto.company,
                  "chdrnum": that.euruVO.chdrnum
                }
                findDuw0101MClmByChdrcoyChdrnum(params1).then(res1=>{
                  if (res1.resultCode == constant.SUCCESS && res1.data != null) {
                    let list = res1.data;
                    that.insTabInfo.insCoreReasons = list;
                  }
                  that.isCoreReason = true;
                }).catch(err=>{

                })
              }
            }else{
              that.isCoreReason = true;
            }
          }
        }).catch(err=>{

        })
        that.isCoreReason = true;


      },

      // 组件部分方法开始---
      // 投保记录
      getSubRecordFlag(e) {
        this.recordFlag = e;
      },

      // 提核原因
      getSubComplainFlag(e) {
        this.complainFlag = e;
      },

      // 累计保额
      getSubCumAmountFlag(e) {
        this.cumAmountFlag = e;
      },

      // 理赔历史
      getSubClaimsFlag(e) {
        this.claimsFlag = e;
      },

      // 保全记录
      getSubSaveDamageFlag(e) {
        this.saveDamageFlag = e;
      },

      // 异常告知一览
      getSubAbnormityFlag(e) {
        this.abnormityFlag = e;
      },

      // 补充告知一览
      getSubReportFlag(e) {
        this.reportFlag = e;
      },

      // 委托人信息
      getSubConsignorFlag(e) {
        this.consignorFlag = e;
      },

      // 提交报告
      getSubHealthFlag(e) {
        this.healthFlag = e;
      },

      // Notepad
      getSubNotepadFlag(e) {
        this.notepadFlag = e;
      },
      getInsNoteSize(e){
        this.insNoteSize = e;
      },

      // 个人税收居民身份证明
      getSubIDFlag(e) {
        this.IDFlag = e;
      },

      // 复核意见
      getSubReviewFlag(e) {
        this.reviewFlag = e;
      },
      getSubCoreReasonFlag(e) {
        this.coreReasonFlag = e;
      },
      getRouterData() {
        this.clmnum = this.$route.params.applnum;
        this.readonly = this.$route.query.readonly;
        let arrs = this.$store.getters['loading/GET_IS_XQ_OPEN']
        debugger
        let flag = false;
        if(arrs.length>0){
          arrs.map(item=>{
            if(item == this.clmnum){
              flag = true;
            }
          })
        }
        this.isOpen = flag;

        if( !this.isOpen){
          this.doUwClick();
        }else{
          if(!this.pageData || this.pageData.length==0){
            this.doUwClick();
          }
        }
        console.log(this.clmnum)
      },
        saveByF8(event) {
            var e = event || window.event || arguments.callee.caller.arguments[0];
            //F8保存
            if (e && e.keyCode == 119) {
                this.doSave();
            }
        },
    },


    //页面初始化调用doUwClick
    created() {
        this.$destroyCacheKey()
      // this.getRouterData();
      // this.doUwClick();
      console.log("created...")
    },
    activated() {
        this.$destroyCacheKey()
      this.getRouterData();
      // this.doUwClick();
      console.log("activeted...")

      document.onkeydown = this.saveByF8;
    },
      destroyed() {
          document.onkeydown = null;
          document.removeEventListener('click', this.clickEvent);
          clearTimeout(this.doUwClickSetTimeout);
          clearTimeout(this.onChangeFlag01SetTimeout);
          clearTimeout(this.notRenewSetTimeout);
          clearTimeout(this.changeNotreSetTimeout);
          clearTimeout(this.postilSetTimeout);
          clearTimeout(this.savePostilSetTimeout);
          clearTimeout(this.backSetTimeout);
          clearTimeout(this.backNulSetTimeout);
          clearTimeout(this.doSaveSetTimeout);
          clearTimeout(this.addCostSetTimeout);
          clearTimeout(this.calcClickSetTimeout);
          clearTimeout(this.addPremSureSetTimeout);
      },

      //页面管道信息
    filters: {
      flag01Pipe: function (value) {
        return flag01Pipe(value);
      }
    }
  }
</script>
<style lang="less" scoped>
    .underwriting {
        background: #f5f5f5;

        .underwriting-base {
            position: relative;

            .el-tabs__nav {
                padding: 0 20px;
            }

            .base-title {
                background: #fff;

                .item-title {
                    padding: 20px;

                    .item {
                        margin-bottom: 15px;
                        cursor: pointer;
                        color: #666;
                    }
                }
            }

            .base-mian {

                border: 1px solid #e1e1e1;
                border-radius: 4px;
                background: #f5f5f5;

                .base-mian-cell {
                    margin-top: 10px;
                    background: #fff;

                    .base-mian-cell-title {
                        padding: 0 20px;
                        height: 50px;
                        line-height: 50px;
                        border-bottom: 1px solid #e1e1e1;

                        .left {
                            .line {
                                color: #f76767;
                            }

                            .tips {
                                margin-left: 15px;
                            }
                        }

                        .right {
                            padding: 0 20px;
                            cursor: pointer;
                        }
                    }

                    .base-mian-cell-main {
                        padding: 20px;
                    }
                }
            }
        }

        .except-main {
            width: 50%;
            position: absolute;
            background: #fff;
            border-radius: 4px;
            top: 20%;
            z-index: 1000;
            padding: 20px;
            box-shadow: 0 0 10px #e1e1e1;
            z-index: 10000;
            height: 400px;
            overflow: auto;

            .back-con {
                text-align: center;

                button {
                    height: 30px;
                    padding: 0 20px;
                    background: #fff;
                    border: 1px solid #e1e1e1;
                    border-radius: 4px;
                    cursor: pointer;

                    &:hover {
                        color: #f56c6c;
                        background: #fef0f0;
                        border-color: #fbc4c4;
                    }
                }
            }
        }

        .txt-line {
            color: #68A3FC;
            text-decoration: underline;
            cursor: pointer;
        }

        .txt {
            color: #68A3FC;
            cursor: pointer;
        }

        .complain-lab {
            line-height: 28px;
            text-align: right;
            display: block;
            padding-right: 10px;
            box-sizing: border-box;
        }

        .mb10 {
            margin-bottom: 10px;
        }

        .com-title {
            background: #f5f5f5;
            height: 40px;
            line-height: 40px;
            padding: 0 20px;

            .left {
                .line {
                    color: #f76767;
                }

                .tips {
                    margin-left: 15px;
                }
            }
        }

        .check-main {
            padding: 20px 20px 0 20px;
            cursor: pointer;
        }

        .check-info {
            height: 36px;
            padding: 0 20px;
            border: 1px solid #f76565;
            border-radius: 3px;
            color: #f76565;
            background: #fff;
            cursor: pointer;
        }

        .check-info-def {
            height: 36px;
            padding: 0 20px;
            border: 1px solid #e1e1e1;
            border-radius: 3px;
            color: #666;
            background: #fff;
            cursor: pointer;
        }

        .edit-main {
            text-align: center;
            margin-top: 15px;
            cursor: pointer;

            button {
                height: 36px;
                padding: 0 30px;
                color: #fff;
                background: #f76565;
                border-radius: 4px;
            }
        }

        .com-txt {
            line-height: 28px;
        }

        .com-txt-line {
            line-height: 28px;
            color: #68A3FC;
            text-decoration: underline;
            cursor: pointer;
        }

        .policy-main {
            margin-top: 10px;
            background: #fff;
            position: relative;

            .policy-main-title {
                height: 40px;
                line-height: 40px;
                padding: 0 20px;
                box-sizing: border-box;
                border-bottom: 1px solid #e1e1e1;

                span {
                    margin-left: 8px;
                }
            }

            .policy-main-container {
                padding: 20px;

                .tabs {
                    .tabs-item {
                        div {
                            height: 40px;
                            line-height: 40px;
                            padding: 0 20px;
                            border-radius: 4px 4px 0 0;
                            background: #f2f2f2;
                            text-align: center;
                            cursor: pointer;

                            &.active {
                                background: #f76565;
                                color: #fff;
                            }
                        }
                    }
                }

                .main {
                    padding: 20px;
                    border: 1px solid #e1e1e1;

                    .main-cell {
                        .main-cell-title {
                            height: 50px;
                            line-height: 50px;

                            .line {
                                color: #f76767;
                                margin-right: 8px;
                            }
                        }
                    }
                }
            }
        }

        .com-block {
            padding: 0 10px;
            height: 40px;
            line-height: 40px;
            background: #f5f5f5;

            .com-price {
                color: #FF0000;
            }
        }

        .com-checkbox {
            padding: 0 10px;
            line-height: 36px;
        }

        .com-lab {
            line-height: 36px;
            height: 36px;
            padding: 0 10px;
            text-align: right;
        }

        .com-select {
            height: 36px;
            line-height: 36px;
        }

        .position-re {
            position: relative;
        }

        .position-abs {
            position: absolute;
        }

        .posi-abs-top {
            position: absolute;
            right: 20px;
            top: 10px;

            .lab {
                color: #00C1DE;
                cursor: pointer;
            }
        }

        .position-abs-left {
            position: absolute;
            top: 12px;
            z-index: 10;
            left: 280px;
            color: #68A3FC;
            text-decoration: underline;

            .lab {
                cursor: pointer;
            }
        }

        .position-abs-right {
            position: absolute;
            top: 12px;
            z-index: 10;
            right: 20px;
            color: #68A3FC;
            text-decoration: underline;

            .lab {
                cursor: pointer;
            }
        }

        .pic-select-mian {
            position: relative;
        }

        .select-main {
            width: 50%;
            position: absolute;
            background: #fff;
            border-radius: 4px;
            top: 20%;
            z-index: 1000;
            padding: 20px;
            box-shadow: 0 0 10px #e1e1e1;

            .back-con {
                text-align: center;

                button {
                    height: 30px;
                    padding: 0 20px;
                    background: #fff;
                    border: 1px solid #e1e1e1;
                    border-radius: 4px;
                    cursor: pointer;

                    &:hover {
                        color: #f56c6c;
                        background: #fef0f0;
                        border-color: #fbc4c4;
                    }
                }
            }
        }

        .note-main {
            .note-logo {
                width: 50%;
                margin: 0 auto;
                display: block;
            }

            .tit {
                color: #000;
                font-weight: 600;
            }

            .tip {
                color: #000;
                text-indent: 28px;
                margin-top: 5px;
            }

            .com-note {
                padding: 0 0 0 56px;
                color: #000;

                .com-txt {
                    .lab {

                    }

                    .txt {
                        color: #000;
                        cursor: inherit;
                    }
                }
            }

            .como-title {
                color: #000;
            }

            .com-title-txt {
                color: #000;
                text-indent: 28px;
                margin-top: 5px;
            }

            .com-bom-txt {
                color: #000;
                text-align: right;
                margin-bottom: 5px;

                .sign {
                    display: inline-block;
                    width: 100px;
                    border-bottom: 1px solid #333;
                }

                .si {
                    display: inline-block;
                    width: 35px;
                    border-bottom: 1px solid #333;
                }
            }

            .com-center-tit {
                text-align: center;
                color: #000;
                margin-bottom: 15px;
            }

            .com-center-list {
                li {
                    list-style: circle;
                    color: #000;
                }
            }

            .com-center-bom {
                color: #000;
                margin-top: 10px;
            }

        }

        .operationIcon {
            // padding: 12px;
            border: 1px solid #e5e5e5;
            border-radius: 50%;
            width: 22px;
            height: 22px;
            display: inline-block;
            cursor: pointer;
            box-shadow: 0 0 3px #f9f9f9;

            .item {
                color: #68A3FC;
            }
        }


    }
</style>
